function get_url($url){
$urls = parse_url($url);
$path_url = array_map('rawurldecode', explode('/', $urls['path']));
return
$urls['scheme'] . '://' .
$urls['host'] .
implode('/', array_map('rawurlencode', $path_url));
}
echo file_url("http://youadomain.ru/you file1.jpg");