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



untrailingslashit ›

Since2.2.0
已弃用n/a
untrailingslashit ( $string )
参数:
  • (string) $string What to remove the trailing slashes from.
    Required: Yes
返回:
  • (string) String without the trailing slashes.
定义在:
文档:

Removes trailing forward slashes and backslashes if they exist.

The primary use of this is for paths and thus should be used for paths. It is not restricted to paths and offers no specific path support.



源码

function untrailingslashit( $string ) {
	return rtrim( $string, '/\\' );
}