Posted by Janwillem Borleffs on 08/05/06 20:53
Dave Monk wrote:
> I want to create a small number of variables, $pos1, $pos2 ... $pos5
> within a loop and assign them values from an array, but creating the
> variable names with incrementing numbers, well I've no idea how the
> PHP syntax for it works.
>
$pos = 'prefix';
.....
${$pos.$a} = $myarray[$a];
JW
[Back to original message]
|