PHP : eval
PHP : eval
- Started
- Last post
- 4 Responses
- tobor
FOCKER!
$num = 1;
$name1 = "Working";
echo eval(""$name".$num");====================
I get an error. What am I doing wrong in the eval function?
- unfittoprint0
echo eval($name1.$num);
or
echo eval("$name1" .$num);
- tobor0
NIEN!
I'm trying to have an eval result of $name1, by adding $num to the end of $name.
- meph5040
In PHP 4, eval() returns NULL unless return is called in the evaluated code -php.net
the sample below works fine
$num = 1;
$name1 = "Working";echo (eval("return $name$num;"));
- tobor0
Sank-you