Answers for "php convert path from server url to link"

PHP
0

php convert path from server url to link

function path2url($file, $Protocol='http://') {
    return $Protocol.$_SERVER['HTTP_HOST'].str_replace($_SERVER['DOCUMENT_ROOT'], '', $file);
}
Posted by: Guest on January-06-2022

Browse Popular Code Answers by Language