WordPress开发者和主题制作者的搜索引擎



wp_basename ›

Since3.1.0
已弃用n/a
wp_basename ( $path, $suffix = '' )
参数: (2)
  • (string) $path A path.
    Required: Yes
  • (string) $suffix If the filename ends in suffix this will also be cut off.
    Required: No
    默认: (empty)
返回:
  • (string)
定义在:
文档:

i18n friendly version of basename()



源码

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