[thelist] Please help.. PHP guru's
Kasimir K
evolt at kasimir-k.fi
Thu Feb 24 07:49:24 CST 2005
> I have a string:
> $str = '<p>This is a paragraph<p><?php echo \'hello\';
> ?>';
>
> Which I convert using:
> html_entity_decode(stripslashes($str));
>
> Which result in:
> <p>This is a paragraph</p><?php echo 'hello'; ?>
>
>
> But.. I need to manipulate the string in such a way that the PHP tags to
> STAY ENCODED like:
> <p>This is a paragraph</p><?php echo 'hello'; ?>
The easiest might be that after html_entity_decode you just replace
'<?php' and '?>' with '<?php' and '?>' using str_replace().
.k
More information about the thelist
mailing list