I do have variables like
<?php
$num1 = 'txt1';
$num2 = 'txt2';
$num3 = 'txt3';
...
and I do have a loop
for ($i=1; $i<100; $i++){
echo 'This is textNr'.$i.':' .$num.$i ;
}
I need to produce a result like:
This is textNr1: txt1
Of course with this code i would get something like:
This is textNr1: 'undefined'
,because in $num.$i the $num is not defined;
so $num.$i should be parsed once and become $num1 and then $num1 should be parsed a second time like:
echo 'This is textNr'.$i.':' .$num1 ;
Does anybody know how to handle this, or could give me a link about this problem and maybe the technical term of this problem (solved :) variable variables)?
Please feel free to edit my question, into something which will fit this case better!
$num.$i
can get$num1
if$i=1
– pinkpanther 14 hours ago$i
like$num.$i == $num1
etc. But this is the wrong approach... – elclanrs 14 hours ago