note 73625 added to function.str-replace
| From: | dot) | Date: | Sun, 04 Mar 2007 22:31:22 +0000 |
| Subject: | note 73625 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124076@lists.php.net to get a copy of this message | ||
A little enhancement to heavyraptor's replace_accents (simply adding 'cedil' and
'ring' character variations) :
<?php
function replace_accents($s) {
$s = htmlentities($s);
$s = preg_replace ('/&([a-zA-Z])(uml|acute|grave|circ|tilde|cedil|ring);/',
'$1', $s);
$s = html_entity_decode($s);
return $s;
}
?>
Cheers.
----
Server IP: 217.174.196.197
Probable Submitter: 88.165.140.146
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- https://master.php.net/note/edit/73625
Del: integrated -- https://master.php.net/note/delete/73625/integrated
Del: useless -- https://master.php.net/note/delete/73625/useless
Del: bad code -- https://master.php.net/note/delete/73625/bad+code
Del: spam -- https://master.php.net/note/delete/73625/spam
Del: non-english -- https://master.php.net/note/delete/73625/non-english
Del: in docs -- https://master.php.net/note/delete/73625/in+docs
Del: other reasons-- https://master.php.net/note/delete/73625
Reject -- https://master.php.net/note/reject/73625
Search -- https://master.php.net/manage/user-notes.php