function trailingslashit($string) {}

Appends a trailing slash.
Will remove trailing slash if it exists already before adding a trailing slash. This prevents double slashing a string or path.


  • string $string: What to add the trailing slash to.

Return values

returns:String with trailing slash added.

Source code

function trailingslashit($string) {

	return untrailingslashit($string) . '/';



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: Logo

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

Facebook photo

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

Connecting to %s

%d bloggers like this: