Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Path get last argument
- This function returns the last argument (filename or directory name) of an given path.
- */
- function path_get_last_arg($path){
- $path = str_replace('\\', '/', $path);
- $path = preg_replace('/\/+$/', '', $path);
- $path = explode('/', $path);
- $l = count($path)-1;
- return isset($path[$l]) ? $path[$l] : '';
- }
Advertisement
Add Comment
Please, Sign In to add comment