willpower Posted November 15, 2006 Share Posted November 15, 2006 HiI have a string called $text.It looks like this $text="<h1>Vacancies</h1>[INCLUDE JOBLIST]<p>for more information...blah</p>"Now I need to echo the $text so that the [INCLUDE JOBLIST] becomes <? include 'joblist.php;?>Now clearly if i str_replace and echo I simply get the <? include 'joblist.php;?> showing in the HTML but the php parser doesnt know what to do with it as its not actually a command itself...its merely part of the string to echo....Any ideas how I can break the echo insert and include and then return to the rest of the echo.The reason I need to do this is as part of a CMS. I need to allow the user to enter some basic BBCode type commands into a text field in a database and the output be useful.Hope all that made sense.Will Link to comment https://forums.phpfreaks.com/topic/27394-str_replace-but-with-a-difference/ Share on other sites More sharing options...
trq Posted November 16, 2006 Share Posted November 16, 2006 Take a look at [url=http://php.net/eval]eval[/url]. Link to comment https://forums.phpfreaks.com/topic/27394-str_replace-but-with-a-difference/#findComment-125286 Share on other sites More sharing options...
willpower Posted November 16, 2006 Author Share Posted November 16, 2006 Ooooooh I could kiss you....thanks so much Link to comment https://forums.phpfreaks.com/topic/27394-str_replace-but-with-a-difference/#findComment-125302 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.