How to parse PHP tags in a string?
| From: | Zak Mc Kracken | Date: | Wed, 07 Feb 2007 17:04:46 +0000 |
| Subject: | How to parse PHP tags in a string? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-248499@lists.php.net to get a copy of this message | ||
Hi all,
Is there a PHP function that parses a string as it was the content of a
PHP file?
I have a CMS application and editors write the news items text into a
text area. Since they have some knowledge of PHP, I'd like to allow them
to insert <? ... ?> or <?= ... ?> and have the content blocks parsed and
executed. OK, this could be easily done parsing the string and passing
the block contents to eval(). However I wonder wether there is some
function already doing that (maybe in a more efficient way).
Thanks a lot in advance.
===============================================================================
Marco Brandizi [marco_AT_leafbioscience_DOT_com]
http://gca.btbs.unimib.it/brandizi