eval problem
Posted: Fri Sep 05, 2008 5:23 am
any ide a to do working that ?
$description = "hello all my age is <code> $age = date("Y/m/d"); </code> years old"; // this is a result from mysql data base
$description preg_replace("[<code>]", "' "; eval(' , $description);
$description preg_replace("[</code>]", " '); echo " '", $description);
echo "$description"; // this print: echo "hello all my age is"; eval( '$age = date("Y/m/d"); '); echo " years old ";
any good idea ?
$description = "hello all my age is <code> $age = date("Y/m/d"); </code> years old"; // this is a result from mysql data base
$description preg_replace("[<code>]", "' "; eval(' , $description);
$description preg_replace("[</code>]", " '); echo " '", $description);
echo "$description"; // this print: echo "hello all my age is"; eval( '$age = date("Y/m/d"); '); echo " years old ";
any good idea ?