View Single Post
Old 06-08-2010, 11:14 AM   PM User | #1
itxen
New to the CF scene

 
Join Date: Aug 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
itxen is an unknown quantity at this point
Add ending slash

function add_ending_slash($path){

$slash_type = (strpos($path, '\\')===0) ? 'win' : 'unix';

$last_char = substr($path, strlen($path)-1, 1);

if ($last_char != '/' and $last_char != '\\') {
// no slash:
$path .= ($slash_type == 'win') ? '\\' : '/';
}

return $path;
}

Last edited by vinyl-junkie; 06-08-2010 at 12:51 PM.. Reason: signatures only allowed through the control panel
itxen is offline   Reply With Quote