Hello all,
Maybe I'm tired or maybe I'm begining to lose my mind. Either way I'm stumped as to why my tiny little php script won't work.
I'm in the process of learning at the moment and have come across eval. My understanding is that you pass a string to it and it can execute it as if it were php code. This opens up possibilities for coding on the fly or keeping code in a database. This right?
Anyway...
I copied and pasted the following code from a manual and get the following error.
<?php
$str = "exit()";
eval($str);
?>
Parse error: parse error, unexpected $end in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Learning\test.php(3) : eval()'d code on line 1
I am sure that this is something really stupid on my part.
Any ideas?
Thanks in advance.