Hi,
take a look at the (simplified) code:
$Text = "foobar #r# and so on...";
$align = array ("r" => "ALIGN=right", "l" => "ALIGN='left'");
$patterns= array("/#(.+)#/");
$replace= array("$align[\1]");
$Text = preg_replace($patterns,$replace, $Text);
You probably can guess my intention:
I want to replace the pattern '#key#' with the appropriate value of the array 'align', depending on the key, that is to be found between those two '#'. That means, the result should look like this:
$Text = "foobar ALIGN=right and so on...";
I have tried quite everything with the '/e' modifier, which should have helped as I thought...in vain.
Yes, the example doesn't make much sense...
Thanks a lot for any advice!