一起加入两个文件系统路径。
原型
path_join( string $base, string $path )
描述
例如,‘给我$ $相对于$ base的路径’。如果$ path是绝对路径,则返回完整路径。
参数
$base
(string)
(Required)
基本路径。
$path
(string)
(Required)
相对于$ base的路径。
返回值
(string)
具有基本路径或绝对路径的路径。
源文件
路径:wp-includes/functions.php
<?php
...
function path_join( $base, $path ) {
if ( path_is_absolute($path) )
return $path;
return rtrim($base, '/') . '/' . ltrim($path, '/');
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/path_join/