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



untrailingslashit › WordPress Function

Since2.2.0
已弃用n/a
untrailingslashit ( $value )
参数:
  • (string) $text Value from which trailing slashes will be removed.
    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( $value ) {
	return rtrim( $value, '/\\' );
}