A WordPress-centric search engine for devs and theme authors



untrailingslashit ›

Since2.2.0
Deprecatedn/a
untrailingslashit ( $string )
Parameters:
  • (string) $string What to remove the trailing slashes from.
    Required: Yes
Returns:
  • (string) String without the trailing slashes.
Defined at:
Codex:

Removes trailing forward slashes and backslashes if they exist.

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.



Source

function untrailingslashit( $string ) {
	return rtrim( $string, '/\\' );
}