note 17625 added to function.preg-replace
| From: | php at egotwist dot com | Date: | Mon, 17 Dec 2001 17:17:21 +0000 |
| Subject: | note 17625 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-22989@lists.php.net to get a copy of this message | ||
<P>
You can use preg_replace to convert special charaters to upper or lower case. It also handles normal
characters:
</P>
Convert to upper case:
$s = preg_replace("/([a-z]|[à-þ])/e", "chr(ord('\\1')-32)", $s);
Convert to lower case:
$s = preg_replace("/([A-Z]|[À-Þ])/e", "chr(ord('\\1')+32)", $s);
--
http://www.php.net/manual/en/function.preg-replace.php
http://master.php.net/manage/user-notes.php?action=edit+17625
http://master.php.net/manage/user-notes.php?action=delete+17625
http://master.php.net/manage/user-notes.php?action=reject+17625