This should be useful which handles almost all the cases.
function Unaccent($string)
{
return preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml|caron);~i', '$1', htmlentities($string, ENT_COMPAT, 'UTF-8'));
}
More Related Contents:
- Warning: preg_replace(): Unknown modifier
- Replace preg_replace() e modifier with preg_replace_callback
- Replace URLs in text with HTML links
- php regex to match outside of html tags
- Remove multiple whitespaces
- Convert plain text URLs into HTML hyperlinks in PHP
- Convert string into slug with single-hyphen delimiters only
- PHP remove special character from string
- Replace multiple newlines, tabs, and spaces [duplicate]
- Extract URL from string
- What Delimiter to use for preg_replace in PHP (replace working outside of PHP but not inside)
- Regular expressions for a range of unicode points PHP
- PHP using preg_replace : “Delimiter must not be alphanumeric or backslash” error
- Replace only first match using preg_replace [duplicate]
- Unknown modifier ‘/’ error in PHP [duplicate]
- Regex to strip comments and multi-line comments and empty lines
- Replace tabs and spaces with a single space as well as carriage returns and newlines with a single newline
- How to properly escape a backslash to match a literal backslash in single-quoted and double-quoted PHP regex patterns
- regular expression and forward slash
- Regex / DOMDocument – match and replace text not in a link
- PHP Preg-Replace more than one underscore
- Regex ignore URL already in HTML tags
- PHP regular expressions: No ending delimiter ‘^’ found in
- Retrieve all hashtags from a tweet in a PHP function
- How to write a recursive regex that matches nested parentheses?
- Using regex to filter attributes in xpath with php
- Regex for password PHP [duplicate]
- Youtube I.D parsing for new URL formats
- Regex to match an IP address [closed]
- PHP’s preg_replace regex that matches multiple lines