如何在用encodeURIComponent()编码的php中解码url?
我已经尝试过urldecode(),但是..我不知道我编码的url ...
我必须用php做这件事..
发布于 2013-03-26 21:28:09
您可以使用此函数:
<?php
$string = 'http%3A%2F%2Fexample.com';
$output = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($string));
echo html_entity_decode($output,null,'UTF-8');
?>
输出将为:http://example.com
https://stackoverflow.com/questions/2757911
复制相似问题