For whatever reason, preg_replace always kicks my ass. I've tried fifty different combos, and can't get this to work. Here's what I'm trying to do:
input string: [%1%%1099947597%]
that's 1 for user 1 and a unix timestamp.
Optimal output:
Updated by Name on 11/08/04.
Attempt:
$text = preg_replace("/[\%(.+)\%\%(.+)\%]/ie", 'Updated by $user[$1] at '.date($dateformat,'$2').": ",$text);
that doesn't work. This does:
$text = preg_replace("/[\%(.+)\%\%(.+)\%]/ie", '$user[$1]', $text);
but even adding a colon to the replacement to read '$user[$1]: ' produces a parse error.
Could someone please help?
MUCH APPRECIATED!