Created
July 25, 2011 12:52
-
-
Save sorki/1104054 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$txt = 'abcd ***animation(text1|text2) defg ***animation(txt1|txt2)'; | |
function replace_anim($matches) { | |
return '[[Replaced: 1-"'.$matches[1].'"-2-"'.$matches[2].'"]]'; | |
} | |
$ret = preg_replace_callback('~\*\*\*animation\(([^|]+)\|([^|]+)\)~', "replace_anim", $txt); | |
echo $ret; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment