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

Popular posts from this blog

python 3 IndexError: list index out of range -

android - How to save instance state of selected radiobutton on menu -

IF statement in MySQL trigger -