public function http2https($url){
if(preg_match("/^(http:\/\/).*$/", $url)){
$result = preg_replace("/^http:\/\//", "https://", $url, 1);
return $result;
}
return $url;
}
转载于:https://my.oschina.net/u/2351685/blog/1507123