Re: parse_string() or similar functionality?
| From: | Faisal Nasim | Date: | Tue, 06 Jun 2000 15:10:47 +0000 |
| Subject: | Re: parse_string() or similar functionality? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-20332@lists.php.net to get a copy of this message | ||
|How easy would it be to add something like this:
|
| $string = 'The date is <? echo date("d-M-Y"); ?> today!';
| echo $string;
| $new = parse_string($string);
| echo $new;
|
|The output would be:
|
| The date is <? echo date("d-M-Y"); ?> today!
| The date is 06-06-2000 today!
I posted this a while back, here it is again:
<?
$string = 'The date is <? echo date("d-M-Y"); ?> today!';
echo $string;
echo "\n";
$new = eval ("?>$string");
echo $new;
?>
Enjoy!
Faisal.