hi dan, its because the html text is from user input. and i dont wanna spend too much time educating them on coding with php. sometime its a pain trying to get them to understand the codes. so i just wanna give them some simple commands in php whereby they can happily insert date formats on a page. something like what phpBB did on the [url] thingie.
lance Analysis & Solutions wrote: > Hi Lance: > > On Sun, Jun 16, 2002 at 01:31:45AM +0800, Lance wrote: > >>i was developing an application that will read in the content of a html >>file. and within this html file contains php variables which will be >>replaced using the eval() function with its required value. and within >>this html, i want to be able to run php functions. >>... snip ... >>eval("\$rs = \"<span class=\"normal\">".date("m d >>y")."$phpVar</span>\";"); > > > Why not merge your PHP and HTML straight up like this? > > <span class="normal"><?php echo date('m d y') . $phpVar; ?></span> > > Then, just have the whole HTML file parsed as PHP. > > --Dan > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php