what is the simplest method to do the following
Look at a block of text and anywhere it finds %sometxt% replace that with something else,
So basically any text that is enclosed within a set of percentage signs similar to how Smarty do this?
what is the simplest method to do the following
Look at a block of text and anywhere it finds %sometxt% replace that with something else,
So basically any text that is enclosed within a set of percentage signs similar to how Smarty do this?
The simplest method you asked for:
$blockOfText = str_replace('%sometxt%', 'something else', $blockOfText);
You just replace it with str_replace
.