Thursday, 15 January 2015

Determining whether URL is a second-level subdirectory using PHP -



Determining whether URL is a second-level subdirectory using PHP -

i need image display on website in second-level subdirectories only. if url www.mywebsite.com/ or www.mywebsite.com/subdirectory1/ don't want image appear.

however if url www.mywebsite.com/subdirectory1/subdirectory2/ want image appear.

how go determining if i'm in second-level subdirectory using php? utilize is_dir?

if (count(explode("/",$_server["server_name"]))>=3) { echo "im in 2nd level"; } else { echo "im 1st level"; }

should abit of hack works.

php url subdirectory

No comments:

Post a Comment