Jump to content

Print VALUE of variable, not variable name?


kernelgpf

Recommended Posts

[code]$space='$row[space';
$space.="$i]";
$space="$space";
$spacepic='$row[space';
$spacepic.="$i";
$spacepic.='pic]';
$spacepic="$spacepic";[/code]

Basically, this code is running in a for loop, and $i is the incremented number.. the possible variables are space1, space2, space3, etc. etc. up until 9, and I've got it to add the $i in, but now when I ask it to print, it's printing the variable name, not the value, because I had to put single quotes around the $i else it would cause a parse error.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.