02-05-2010, 09:21 AM
|
#14 (permalink)
|
|
The Prestige
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
|
The 'e' modifier allows you to have executable code within your replace (hence why its closely related to eval())
PHP Code:
$text = 'This cheese was well expensive! It cost about £30'; echo preg_replace('/([ewc]+?)/e', "strtoupper(\\1)", $text);
//result This ChEEsE Was WEll ExpEnsivE! It Cost about 30
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
|
|
|
|