trailingslashit()
trailingslashit( string $string ) 附加一个尾随斜杠。 Appends a t…
trailingslashit( string $string )
附加一个尾随斜杠。
		Appends a trailing slash.
	
目录锚点:#说明#参数#源码#笔记
说明(Description)
将删除尾随的正斜杠(如果在添加尾随正斜杠之前它已存在)。这可以防止字符串或路径出现双斜杠。它主要用于路径,因此应该用于路径。它不局限于路径,也不提供特定的路径支持。
参数(Parameters)
| 参数 | 类型 | 说明 | 
|---|---|---|
| $string | (string) | 要添加尾随斜杠的内容。 | 
源码(Source)
/**
 * Appends a trailing slash.
 *
 * Will remove trailing forward and backslashes if it exists already before adding
 * a trailing forward slash. This prevents double slashing a string or path.
 *
 * 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.
 *
 * @since 1.2.0
 *
 * @param string $string What to add the trailing slash to.
 * @return string String with trailing slash added.
 */
function trailingslashit( $string ) {
	return untrailingslashit( $string ) . '/';
}| 更新版本 | 源码位置 | 使用 | 被使用 | 
|---|---|---|---|
| 1.2.0 | wp-includes/formatting.php | 11 | 13 | 
笔记(Notes)
基本示例
类别:WordPress 函数手册、 
		本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。







还没有任何评论,赶紧来占个楼吧!