码迷,mamicode.com
首页 > Web开发 > 详细

php 怎样判断一段字符 有没有经过 urlencode 处理

时间:2018-10-31 15:43:08      阅读:723      评论:0      收藏:0      [点我收藏+]

标签:href   lan   highlight   nbsp   就是   判断字符串   hid   style   reg   

有没有百分号

 

判断字符串 执行urldecode 之前和之后是否一致
一致就是没有经过urlencode 不一致就是经过urlencode的

自己方法:判断是否所有:

 if(strpos($cookieHostUrl,%3A)){ //处理经过urlencode的字符串  %3A 是分号
        $cookieHostUrl= urldecode($cookieHostUrl);
    }
    preg_match( "/^(https?:\/\/)?([^\/]+)/i", $cookieHostUrl, $host);
    $from=$host[2];

 

php 怎样判断一段字符 有没有经过 urlencode 处理

标签:href   lan   highlight   nbsp   就是   判断字符串   hid   style   reg   

原文地址:https://www.cnblogs.com/lxwphp/p/9883010.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!