What i'm gonna do is:
function replace_between_something($betweenWhat,$replace_thing,$target){
return preg_replace("/".$betweenWhat."(.*?)".$betweenWhat."/",$replace_thing,$target);
}
$string="Hi, *my* name is 'Soul' and she is 'Maggie'. ";
$replace=replace_between_something("\*","your",$string);
$replace=replace_between_something("'","noname",$replace);
echo $replace;
the output expected is:
Hi, *your* name is 'noname' and she is 'noname'.
but, the real output (which is not as expected):
Hi, your name is noname and she is noname.
How to keep the symbol ??
anybody can help me???
sorry, i just edit my question to show the actual things i wanna do.