wp_basename( string $path, string $suffix = '' )

i18n friendly version of basename()


Parameters

$path

(Required) A path.

$suffix

(Optional) If the filename ends in suffix this will also be cut off.

Default value: ''


Return

(string)


Source

File: wp-includes/formatting.php

function wp_basename( $path, $suffix = '' ) {
	return urldecode( basename( str_replace( array( '%2F', '%5C' ), '/', urlencode( $path ) ), $suffix ) );
}


Changelog

Changelog
Version Description
WP-3.1.0 Introduced.