WP_CLI\Utils

basename()WP-CLI 1.0

No Hooks.

Return

String.

Usage

basename( $path, $suffix );
$path(string) (required)
-
$suffix(string)
-
Default: ''

Code of basename() WP-CLI 2.7.0-alpha

function basename( $path, $suffix = '' ) {
	// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode -- Format required by wordpress.org API.
	return urldecode( \basename( str_replace( [ '%2F', '%5C' ], '/', urlencode( $path ) ), $suffix ) );
}