jgp4 Posted October 25, 2006 Share Posted October 25, 2006 I've been going thru forum after forum looking for an answer to this, but can find nothing, so I hope someone here can help.Say I have a string, and inside it is the text ::include(/includes/snippets/snippet.php)::what i'd like to do is find that text, extract the text from between the ::'s and eval() it, then do a preg_replace to insert the code generated back in - can someone help, I have no idea how to do regex's.Thanks. Quote Link to comment Share on other sites More sharing options...
effigy Posted October 25, 2006 Share Posted October 25, 2006 Use[tt] preg_replace_callback[/tt]; your regex will be [tt]/::(.+?)::/[/tt]. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.