I am writing one function for getting some different database query. Now things are going well but only need to get last directory name from defined path.
$q
you can use this simple snippet:
$qa_path=site_root('/learnphp/docs/'); $qa_path = explode("/", $qa_path); $qa_path = $qa_path[count($qa_path) - 1];