$var='http://www.plus2net.com/sql_tutorial/math.php'; echo dirname($var);
http://www.plus2net.com/sql_tutorial
PHP Directory handling functions dirname: to get name of the directry from a string input is_dir: Getting boolean output after checking if directory exist scandir: Array Listing all directory and files of any given directory getcwd: to get the current directory name chdir: to change the current directory chroot: to change to root directory