public static final function ppath ($path){
		while (!is_dir($path) && strlen($path) > 0){
			$path = preg_replace('/[^\/]+\/?$/', null, $path);
		}

		return !empty($path) ? $path : false;
	}
public static final function ppath ($path){
		while (!is_dir($path) && strlen($path) > 0){
			$path = preg_replace('/[^\/]+\/?$/', null, $path);
		}

		return !empty($path) ? $path : false;
	}
public static final function ppath ( $ path ) { while ( ! is_dir ( $ path ) && strlen ( $ path ) > 0 ) { $ path = preg_replace ( '/[^\/]+\/?$/' , null , $ path ) ; } return ! empty ( $ path ) ? $ path : false ; }
Returns first existing parent directory from given path.

@param string $path
@return string|bool
Returns first existing parent directory from given path .