我如何使用PHP来编码像这个例子的字符串?

时间:2015-12-05 09:42:31

标签: javascript php

我尝试找到一个转换自的编码解决方案:

<script type="text/javascript">document.write(unescape('<html><head><meta http-equiv="refresh" content="0;url='http://clickclick.xyz/go/init?k=nuLOOM+Saffron+Trellis+Ottoman&sc=T1&i=344625174'" /></head></html>'));</script>

<script type="text/javascript">document.write(unescape('%3C%68%74%6D%6C%3E%3C%68%65%61%64%3E%3C%6D%65%74%61%20%68%74%74%70%2D%65%71%75%69%76%3D%22%72%65%66%72%65%73%68%22%20%63%6F%6E%74%65%6E%74%3D%22%30%3B%75%72%6C%3D%27%68%74%74%70%3A%2F%2F%63%6C%69%63%6B%63%6C%69%63%6B%2E%78%79%7A%2F%67%6F%2F%69%6E%69%74%3F%6B%3D%6E%75%4C%4F%4F%4D%2B%53%61%66%66%72%6F%6E%2B%54%72%65%6C%6C%69%73%2B%4F%74%74%6F%6D%61%6E%26%73%63%3D%54%31%26%69%3D%33%34%34%36%32%35%31%37%34%27%22%20%2F%3E%3C%2F%68%65%61%64%3E%3C%2F%68%74%6D%6C%3E'));</script>

但没有找到任何完美的解决方案。

我不知道这个解决方案是什么。

由于

2 个答案:

答案 0 :(得分:1)

你可以使用PHP函数rawurlencode()来完成这项工作。

http://php.net/manual/en/function.rawurlencode.php

答案 1 :(得分:-1)