I created an A-Z index for my wordpress dictionary website. I've got an issue when accents are used on some letters.
I used sanitize to avoid this but now every word beggining with an E is like another letter instead of being grouped. How can I group every word begining with an E regardless of is there an accent or not ?
Here's the link to my page : http://preprod2.atelier-labotte.fr/dictionnaire/
Here's the code I used for creating the index :
<?php
$letter = '';
while($dictionnaire->have_posts())
{
$dictionnaire->the_post();
// Check the current letter is the same that the first of the title
if($letter != strtoupper(get_the_title()[0]))
{
echo ($letter != '') ? '</div></section>' : '';
$letter = strtoupper(substr(sanitize_title( get_the_title() ),0,1));
echo '<section id="'. $letter .'" class="wp-block-group letter-section"><div class="big-letter"><p>'.strtoupper(substr(sanitize_title( get_the_title() ),0,1)).'</p></div><div class="wp-block-group__inner-container d-grid columns-3">';
}
?>
Thanks for your help !
PS : I'm non-english native speaker, please forgive my mistkakes !