Reply to PHP preg_replace

Your name:

Reply:


Posted by otrWalter on 12/18/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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация