php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #22524 Add a strip_accents function
Submitted: 2003-03-03 15:45 UTC Modified: 2003-04-13 20:47 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: gmarchand at videotron dot ca Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.2.3 OS: Linux
Private report: No CVE-ID: None
 [2003-03-03 15:45 UTC] gmarchand at videotron dot ca
It would be awesome if PHP had the strip_accents() function. Something like strip_tags(), only it removes the accented letters and replace them with their non-accented version. 

For example: 
<? echo strip_accents("Bonjour V?ronique, comment ?a va?") ?>
gives: Bonjour Veronique, comment ca va?

I suppose it would be even better if you could have an optional parameter of allowable accents too.

It would be very useful for searching databases.
For example: on my site, people can search a music band database, but if they don't have the umlauts on their keyboards, and if they search for a band like say "M?tley Cr?e" without typing the umlauts they might not find it. So I have to use an alternate spelling field, but it would be awesome if there were a built-in strip_accents() function. I'm sure it could have many many more applications too :)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 20:01:29 2024 UTC