Advertisements

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

Advertisements

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: