Add ending slash
Adds an ending slash to the given path, makes a difference
between windows and unix paths (keeps orginal slashes)
The normalize_path function is also a good way for doing this...
Author:
Jonas John
License:
Public Domain
Language:
PHP
Created:
05/05/2006
Updated:
05/05/2006
Tags:
directory functions
Feel free to leave a message:
Add a comment
realpath($path) . DIRECTORY_SEPARATOR
return rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
}[/code]
function add_ending_slash( $path )
{
if ( substr( $path, ( 0 - strlen( DIRECTORY_SEPARATOR ) ) ) !== DIRECTORY_SEPARATOR )
{
$path .= DIRECTORY_SEPARATOR;
}
return $path;
}
{
if ( substr( $path, ( 0 - ( int ) strlen( DIRECTORY_SEPARATOR ) ) ) !== DIRECTORY_SEPARATOR )
{
$path .= DIRECTORY_SEPARATOR;
}
return $path;
}