PDA

View Full Version : Using eval()


James Birkett
06-27-2009, 08:08 PM
Could anyone explain how I could use this in terms of parsing PHP on my forum?
I have tried using php.net to understand the syntax of it but I just cannot grasp it.
Thanks in advance.

Dismounted
06-28-2009, 02:09 AM
$foo = "echo 'Hello World!';"
eval($foo); // prints Hello World!
As you can see, usage of this can be VERY VERY DANGEROUS and as such, it is generally discouraged to use this function (apart from the performance issues).