$string = "viewbasket"; if (stristr($string, $_SERVER['PHP_SELF']) === TRUE){ echo "VIEW BASKET"; }else { echo "something else"; }