Return to Snippet

Revision: 17315
at August 31, 2009 22:03 by iloveitaly


Initial Code
function normalize_path($path, $with_slash = true) {
	if($path[0] == DIRECTORY_SEPARATOR)
		if($with_slash) return $path;
		else return substr($path, 1);
	else
		if($with_slash) return DIRECTORY_SEPARATOR.$path;
		else return $path;
}

Initial URL


Initial Description


Initial Title
Normalize File Path PHP

Initial Tags
php, file, path

Initial Language
PHP