function path_join(){
$args = func_get_args();
$paths = array();
foreach ($args as $arg) {
$paths = array_merge($paths, (array)$arg);
}
$paths = array_map(function($p, $k){
if($k == 0){
return rtrim($p, "/");
}else{
return trim($p, "/");
}
}, $paths, array_keys($paths));
return join('/', $paths);
}