Changes backslashes to slashes, also removes a trailing slash.
string $path: The path to modify.
string The modified path.
function sanitizePath($path) {
$path = str_replace('\\', '/', $path);
// Windows path sanitization.
if (substr($path, -1) == '/') {
$path = substr($path, 0, -1);
}
return $path;
}