Re: Cannot print variable name in PHP file
When you use double quotes as a string delimiter, variables within the string are evaluated. With single quotes, you'd get a literal "$value" in $myData instead of the evaluated version. In double quotes, you need to escape the sigil:
PHP Code:
$myData="<?php \$value=".$value."; ?>"; // $value = 15
“Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
"It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)