l95theses Posted July 12, 2007 Share Posted July 12, 2007 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; } Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 12, 2007 Share Posted July 12, 2007 $itemg2 = "citem" . $itemnum2 . "_array[0]"; what is that?? that echoes out nonsense to me Also you don't really understand array usage that well I think because you have a while loop that doesn't at all use the $itemnum properly. Quote Link to comment Share on other sites More sharing options...
btherl Posted July 12, 2007 Share Posted July 12, 2007 Try this inside your loop (or outside.. the more places the better) print $itemg . " = " $$itemg . "\n"; Does everything look like it should? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.