WP_CLI\Utils
is_path_absolute()
Determine whether a path is absolute.
No Hooks.
Returns
true|false.
Usage
is_path_absolute( $path );
- $path(string) (required)
- .
is_path_absolute() is path absolute code WP-CLI 2.13.0-alpha
function is_path_absolute( $path ) {
// Windows.
if ( isset( $path[1] ) && ':' === $path[1] ) {
return true;
}
return isset( $path[0] ) && '/' === $path[0];
}