Jump to content

Archived

This topic is now archived and is closed to further replies.

jgp4

some1 who knows regex + eval pls help!!!

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Use[tt] preg_replace_callback[/tt]; your regex will be [tt]/::(.+?)::/[/tt].

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.