English 中文(简体)
缩略语
原标题:Symbols bug in urlencode, PHP [closed]
  • 时间:2011-11-23 03:17:24
  •  标签:
  • php
  • html

目前,我正在撰写一份由狗文档生成的html文档的主子。 插图中包含像甲型苯乙醇等符号......问题在于我读了urldecode(urlencode(alpha));,没有给出符号。

找到我的问题只是检查

urldecode("%0A%20%20If%20%3Ci%20style%3D%22mso-bidi-font-style%3Anormal%22%3E%CE%B1%3C%2Fi%3E%2C%20b%2C%20g%0A%20%20be%20the%20zeroes%20of%20the%20polynomial%20%3Ci%20style%3D%22mso-bidi-font-style%3Anormal%22%3Eax%3C%2Fi%3E%3Csup%3E3%3C%2Fsup%3E%0A%20%20%2B%20b%3Ci%20style%3D%22mso-bidi-font-style%3Anormal%22%3Ex%3C%2Fi%3E%3Csup%3E2%3C%2Fsup%3E%20%2B%20c%3Ci%20style%3D%22mso-bidi-font-style%3Anormal%22%3Ex%3C%2Fi%3E%20%2B%20d%2C%20the%20the%20value%20of%20%3Ci%20style%3D%22mso-bidi-font-style%3Anormal%22%3E%26nbsp%3B%CE%B1%3C%2Fi%3Eb%20%2B%20bg%20%2B%20g%3Ci%20style%3D%22mso-bidi-font-style%3Anormal%22%3E%20%CE%B1%3C%2Fi%3E%26nbsp%3B%20is%0A%20%20");

是否有办法解决这一问题?

最佳回答

你的特性是错的。 文号可能贴上UTF-8,但你将这个网站解释为其他东西,很可能是拉丁-1。 证实,UTF-8从你们的浏览器中选择;编码菜单。 建立一个适当的header ,因此,网站总是使用UTF-8:

header( Content-Type: text/html; charset=utf-8 );

这意味着,你还需要确保你的网站其余部分有效,否则与你的文本相匹配。

问题回答
You can used javascript function  unescape($urlfordecode);
Its decode your url, if you want to mannually check then used following url

http://meyerweb.com/eric/tools/dencoder/“rel=“nofollow”http://meyerweb.com/eric/tools/dencoder/

采用以下规范:

  $urlfordecode ="Your encoded url place here";

    $a = explode( & , $urlfordecode);
    $i = 0;
    while ($i < count($a)) {
        $b = explode( = , $a[$i]);
        echo  Your decoded url is  =>  </br> ,htmlspecialchars(urldecode($b[0])), 
        htmlspecialchars(@urldecode($b[1])), "<br />
";
        $i++;
    }




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签