eval problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jim_php
Forum Newbie
Posts: 16
Joined: Sat Mar 22, 2008 6:16 am

eval problem

Post 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 ?
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: eval problem

Post 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.
Post Reply