I have an issue with the below array, where the 1st one (should be Alpe d’Huez) is not escaping/being found.
Am I escaping the apostrophe wrong?
<?php
$images = array (
'Alpe D\'Huez' => 'images/flags/small/france_sm.jpg',
'Le Corbier' => 'images/flags/small/france_sm.jpg',
'Les Deux Alpes' => 'images/flags/small/france_sm.jpg'
);
if (isset($images[$this->item->title])) {
?>
<?php } ?>
That’s perfectly escaped like that.
Maybe the problem is with the value that you are comparing against. Try ‘Alpe D\\’Huez’ to see if in your value the apostrophe is double-escaped or try other apostrophe types like ` or ´