What’s the best way to remove these tags from a string, to prepare it for being passed to eval() ?
for eg. the string can be something like this:
<?php
echo 'hello world';
?>
Hello Again
<?php
echo 'Bye';
?>
Obviously str_replace won’t work because the two php tags in the middle need to be there (the the 1st and the last need to be removed)
Sounds like a bad idea, but if you want the start and end ones removed you could do
This should do it (not tested).
Please tell me also why you want to do it, I’m 95% sure there is a better way.