path_join

Definition:
function path_join( $base, $path ) {}

Join two filesystem paths together (e.g. ‘give me $path relative to $base’).
If the $path is absolute, then it the full path is returned.

Parameters

  • string $base
  • string $path

Return values

returns:The path with the base or absolute path.

Source code

function path_join( $base, $path ) {

	if ( path_is_absolute($path) )

		return $path;



	return rtrim($base, '/') . '/' . ltrim($path, '/');

}

2487

No comments yet... Be the first to leave a reply!

Leave a comment