note 51262 added to function.str-replace

From: Date: Fri, 25 Mar 2005 00:04:11 +0000
Subject: note 51262 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-86924@lists.php.net to get a copy of this message
This is an another accent remover which converts foreign characters to their English equivilent. It converts any character's to their HTML value and then uses preg_replace to find the desired value. The function is based on a earlier entry: replace_accents. function remove_accents( $string ) { $string = htmlentities($string); return preg_replace("/&([a-z])[a-z]+;/i","$1",$string); } example: $string = "êéçýCÉÇÀ"; echo remove_accents( $string ); // will output: eecyCECA ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51262 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51262&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51262&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51262&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51262&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51262&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51262&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86924) next »