论坛风格切换
  • 4824阅读
  • 4回复

php解密js中escape函数 [复制链接]

上一主题 下一主题
离线prisk
 

发帖
278
金币
0
威望
59
只看楼主 倒序阅读 使用道具 楼主  发表于: 2011-10-08
  1. function unescape($str) {
  2.          $str = rawurldecode($str);  
  3.          preg_match_all("/%u.{4}|&#x.{4};|&#d+;|.+/U",$str,$r);  
  4.          $ar = $r[0];  
  5.          foreach($ar as $k=>$v) {  
  6.                   if(substr($v,0,2) == "%u"){
  7.                           // $ar[$k] = iconv("UCS-2","GBK",pack("H4",substr($v,-4)));
  8.                           $ar[$k] = mb_convert_encoding(pack("H4",substr($v,-4)),"GBK","UCS-2");                          
  9.                   }
  10.                   elseif(substr($v,0,3) == "&#x"){
  11.                           $ar[$k] = mb_convert_encoding(pack("H4",substr($v,3,-1)),"GBK","UCS-2");  
  12.                           //$ar[$k] = iconv("UCS-2","GBK",pack("H4",substr($v,3,-1)));  
  13.                   }
  14.                   elseif(substr($v,0,2) == "&#") {
  15.                          $ar[$k] = mb_convert_encoding(pack("n",substr($v,2,-1)),"GBK","UCS-2");  
  16.                          //$ar[$k] = iconv("UCS-2","GBK",pack("n",substr($v,2,-1)));  
  17.                   }  
  18.          }    
  19.          return join("",$ar);  
  20. }
  21. ?>

用iconv可能有中文的乱码问题 mb_convert_encoding对中文的支持比较好
1条评分金币+1
mgarfield 金币 +1 我做了一个艰难的决定 加点分给你 2011-10-10
[img]http://appimg.veryapp.com/pbar/img.php?barhash=4b7ee90840c62e74d81ca326e43bb302d7b460c4[/img]
离线阿百川

发帖
138
金币
0
威望
8
只看该作者 沙发  发表于: 2011-10-10
离线mgarfield

发帖
520
金币
0
威望
62
只看该作者 板凳  发表于: 2011-10-10
我做了一个艰难的决定 加点分给你
离线瓜牛

发帖
85
金币
0
威望
3
只看该作者 地板  发表于: 2011-10-14
不错。用上了。
离线rt932842

发帖
7
金币
15
威望
2
只看该作者 4楼 发表于: 2014-01-04
Ralph Lauren Outlet She selected the theme
She selected the theme, "Tea in the Tropics" and created the function room decor   abundant orchids by Sweet Charity/Kimberley Speer Miller, tables and chairs "dressed" in pink and green organza accents with goody bags in like colors. The tea menu ran from a garnished salad to tea sandwiches, berries with Creme Anglaise and scones with Devonshire cream. The accompanying kiwi wine was naturally tinged palest green..
The restroom is always a good place to have sex at work, because you have some privacy. Just be careful if there is only one stall. Having sex at work is totally naughty, so it better be worth losing your job over.. It a upscale area located on the Ralph Lauren Outlet Asian side with the quality of stores you will see along 5th Ave. In NYC. Anything outside of these malls or the shops on "Bagdat Sokak" can easily be knock offs.
Although the first Ralph Lauren Jakke draft of Hoors was written in 2005, before Black Watch, Burke has reworked it and it has a post coital feel that seems apt for this particular limp social and economic moment. On the day of the first read through, when Burke and the cast sat in a Leith warehouse running lines, the Dunfermline Building Society went bust. Burke, who did some of his growing up in first Rosyth and later Dunfermline, has always been fascinated by the impact economics has on behaviour.
InvestorsObserver's PriceWatch Alerts contain concise, detailed strategies for each stock we cover, including position protection tactics designed to defend investors from potential market shifts. While many other market reports only provide stock news and opinion, we offer strategies that can bulwark investments against uncertainty and increase chances of making a profit, even if a stock goes down."We go above and beyond typical market coverage," said Bruce E. Frey II, Senior Analyst at InvestorsObserver.
He hated it so much, in fact, that he didn want to go back. And we decided that it didn make sense for him to continue. Since it was a sales job and 100 percent commission, he wasn getting paid to be there anyway. HA!, complete failure to adapt, thinking their name will get them by. A isn't a teen status brand anymore (it was HUGE in the early 2000s when preppy logo tees were all the rage) . I find it funny they regularly do 40% off everything after swearing they would never offer any sort of coupon code or sale on regular merchandise because it would devalue the brand.
There is more information available on the Ralph Lauren Outlet obesity crisis in the media than I can recall at any other time in my life. Paradoxically, the general pervasiveness of the perfect body in films and music and TV and advertising imagery is genuinely psychologically damaging and therefore an actual contributory factor to obesity. James Corden wobbling his gut in Mathew Horne's face once a week is not..related articles:
快速回复
限100 字节
批量上传需要先选择文件,再选择上传
 
提到某人:
选择好友
上一个 下一个