Jump to content

Getting php to recognize my dynamic variable


l95theses

Recommended Posts

I'm able to get the $itemg to be a recognized variable to check for, but when i try to change the $ceitem1_array items into a dynamic variable and make it like this

 

  $itemg2 = "citem" . $itemnum2 . "_array[0]";

 

that doesn't work becuase it never seems to evaluate true.

This is the loop snippet of code that i wrote that works correctly.

 

while ( $itemnum < 20 ) {

if ( $$itemg == $citem1_array[0] ) {

echo "$citem1_array[1] - $citem1_array[2]";

echo "<br>";

}

$itemnum = $itemnum + 1;

$itemg = "item" . $itemnum;

}

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.