I'm trying this example:
$input_line = 'hôhô';
preg_match('/hoho/ui', $input_line, $output_array);
But the output_array
is always empty.
Any solution to working with words with accents?
I'm trying this example:
$input_line = 'hôhô';
preg_match('/hoho/ui', $input_line, $output_array);
But the output_array
is always empty.
Any solution to working with words with accents?
If you want to match a specific word, with accented variations, alas you will need to define the alternatives that you will permit for each character. Example:
/h[oòóôõö]h[oòóôõö]/ui
Here's a useful reference table for the Unicode character set: