eval function - I don't know what I am doing wrong...
All manual suggest about the same code as examples:
<code>
<?php
$name = 'Mary';
$name2 = 'Ana';
$a = 'My friends are called $name and $name2';
print $a . "<br>";
eval("\$a = \"$a\";");
print $a . "<br>";
?>
</code>
and it works.
But it does not work in my code
<code>
$s=file_get_contents($_GET['p']); //PAGE
if (!eval("\$str = \"$s\" ;")) {fwrite($f,"error evaluating!\n"); $errorflag=true; }
</code>
the content of the $s is a php-program ECHOing some data...
Or how I can call php for a program, catch and use all of its output in the calling php-program?
Thanks in advance
[PHP Home]
[PHP Users]
[PHP Soap]
[Kernel Newbies]
[Yosemite]
[Yosemite Campsites]