2013-04-17
php相對網址轉絕對網址
相對網址轉絕對網址
function convUrl($url){
$URL_Info = parse_url($url);
if(isset($URL_Info['scheme']))return $url;
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
$output = 'https://';
} else {
$output = 'http://';
}
$url = str_replace('\\','/',$url);
if(!isset($URL_Info['host'])){
if($url{0} == '/'){
$output .= getenv('HTTP_HOST');
}else{
$pnum = substr_count($url,'../');
$url = str_replace('../','',$url);
$path = dirname(getenv('SCRIPT_NAME'));
for($i = 0 ; $i < $pnum; $i++){
$path = substr($path,0,strrpos($path,'/'));
}
$output .= getenv('HTTP_HOST')
.$path
.'/'
;
}
}
return $output.$url;
}
訂閱:
張貼留言 (Atom)
[Unity] Odin Inspector DateTime 時間屬性繪製
Odin Inspector 是一個有名的Unity Inspector Plugin,但沒有為 DateTime 建立可編輯的可視化介面,這邊簡單提供一個可用的方法 。 Odin Inspector 版本 : 3.3.1.14
-
IP Messenger 4.99r3 繁體中文版 介紹:方便區網內傳輸的小工具,又名飛鴿傳書。 支援文字、圖片、檔案、資料夾點對點傳輸。
-
使用環境 : Visual Studio Community 2019 錯誤訊息 : 錯誤 NETSDK1004 找不到資產檔案 '...\obj\project.assets.json'。請執行 NuGet 套件還原,以產生此檔案。
-
Cocos Creator 編譯Android APK失敗的可能原因 Execution failed for task Cocos Creator 版本: 2.3.1 NDK版本:r21 Android SDK:29 編譯方式: default 問題: Windows...
沒有留言:
張貼留言