PHP - Check if a foldername exists in the current page url -
i use php check if current page url has specific folder name , if echo hello
for example: check if domain below has word: newyork
http://www.domain.com/en/newyork/carrental/
as seen above word newyork exists , therefore need echo (hello)
use
$res = get_headers ( $url ) if (strpos($res[0],"200 ok")) { }
more detailed information here: http://php.net/manual/en/function.get-headers.php
Comments
Post a Comment