0

It is possible to make search with preg_grep that finds words with/without accents ? I found this example, I tested and it not works :

$dictionary = array('nestlé');
$pattern = '/^nestle/ui';

$result = preg_grep ( $pattern, $dictionary );

var_dump($result);
Dayron Gallardo
  • 1,502
  • 2
  • 21
  • 37
  • 2
    No, it is not the same question. – Dayron Gallardo Mar 10 '14 at 14:42
  • I believe you would need to create a map of all accented characters and their associated base latin characters and then run a `preg_replace_callback` calling this mapping function. – tenub Mar 10 '14 at 14:45
  • 1
    @DayronGallardo I believe it's very similar, in fact take a look at this regexp using the pattern from the answer in that question: https://xrg.es/#1vsefc0 – SERPRO Mar 10 '14 at 15:04

0 Answers0