je voudrais savoir si quelqu'un peut me dire ce qui ne va pas sur mon code
je cherche à faire un preg match pour trouver si l'URL contient
search_result.php
voici une URL d'exemple
https://www.exemple.com/search_result.p ... rd=samsung
Code : Tout sélectionner
<?php
if (preg_match("/\/search_result$/", $_SERVER['REQUEST_URI'])) {
echo "this page contain search_result";
echo "<br>";
echo $_SERVER['REQUEST_URI'];
} else {
echo "this page not contain search_result";
echo "<br>";
echo $_SERVER['REQUEST_URI'];
}
?>this page not contain search_result
/search_result.php?keyword=samsung&order=BestMatch&listing=All
auriez vous une idée s'il vous plait ?
merci beaucoup pour votre aide