Let's say that I have a bunch of variables names like x1, x2, x3, x4 etc.
If I have a loop, is there a way to I guess create concatenated variables.
Like
for($i; $i<$number; $i++) { print( some code so it will be x1 or x2 etc.); }
Sorry could you explain a little better on what you want to do. You can concatenate a string. But Im not sure what your on about though.😕
for($i; $i<$number; $i++) { eval("echo $x".$i.";"); }
Perhaps you mean to use variable variables?
for ($i = 1; $i < $number; $i++) { echo ${'x'. $i}; }
Thanks laserlight.
That works perfectly.