|
Posted by otrWalter on 11/24/15 11:50
I have a very specific need. Too long to get into what and why here (If
you please).
I have this test code...
$_str = "testing that'S supposed to work!"; // Notice the CAP 'S, this
is the key!
$suffixes = "'S";
$str = preg_replace("/(\\w)($suffixes)\\b/e", '"$1".strtolower("$2")',
$_str);
echo $str;
exit;
It gives me this...
TESTING THAT\'s SUPPOSED TO WORK!
Notice the SLASH?
I don't want the slash. Beyond that, this does what I want it to do.
Please understand, this code is for example only. The question focuses
around the preg_replace(), not on how I get/create "$_str"
Any ideas?
Thanks
WAlter
Navigation:
[Reply to this message]
|