I have a script the needs to dynamically select the name of the proper array and then get data from the array. I am attempting to use eval for this purpose but it is not working.
Here is my code *************
$temp = '\$page';
$temp .= "$pageid";
$temp .= '_array';
print("<P>$pageid");
print("<P>$temp");
eval("\$temp = \"$temp\";");
print("<P>$temp");
//hard coded line works
print("<P><FONT face=arial size=2 color=000000><B>$page1557_array[h1]</B></FONT>");
//the output for
//the hard coded line (above)
//and the dynamic line (below)
//should be the same,
//but they are not!!
//dynamic line does not work
print("<P><FONT face=arial size=2 color=000000><B>$temp[h1]</B></FONT>");
here is the output for the above code ****
1557
\$page1557_array
$page1557_array
h1, this is the text for h1
$