Page 1 of 1

eval problem

Posted: Fri Sep 05, 2008 5:23 am
by jim_php
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 ?

Re: eval problem

Posted: Fri Sep 05, 2008 6:23 am
by jayshields
Haven't you already got a thread open for a very similar problem?

From reading your post, it sounds like you've already solved the problem. You need to post a specific question and show what you've already done including what your existing code actually produces. Also, please use [ php ] tags when posting code, and try to write better English if possible.