參考html
public function http2https($url){ if(preg_match("/^(http:\/\/).*$/", $url)){ $result = preg_replace("/^http:\/\//", "https://", $url, 1); return $result; } return $url; }