求教php大佬一个不用动屌就能解决的问题

搬瓦工机场JMS

if(matchdomain($str)){
                //$str=matchdomain($str);
        $str=strtolower($str);
        $str=str_replace("http://","",$str);
                die("<script>location.href=’$flinkurl$str’;</script>");
        header("Location: $flinkurl$str");
        exit;
想把https://也给替换掉,请怎么改
广西网友:    你直接在

  1. $str=str_replace("http://&quot;,"",$str);

复制代码

下面添加一句呗

  1. $str=str_replace("https://&quot;,"",$str);

复制代码

陕西网友:

  1. $str=str_replace(["http://&quot;,"https://"],"&quot;,$str);

复制代码

浙江网友:str_replace(["http://&quot;,"https://"],"&quot;,$str);
黑龙江网友:我觉得用替换还不如把//前的切掉~~因为以后会碰到回调,str里还有http。
陕西网友:谢谢,哈哈

台湾网友:

  1. $str=str_replace(["http://&quot;,"https://"],"&quot;,$str);

复制代码

以上信息转载自Hostloc。

未经允许不得转载:美国VPS_搬瓦工CN2 GIA VPS » 求教php大佬一个不用动屌就能解决的问题

赞 (0) 打赏

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏