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

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -