<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_34817"> 我在做整合搜索功能时候,前端是js提交参数给php出现乱码,在javascript代码中用 <span style="color:#ff0000;">encodeURIComponent()</span>函数处理中文字符串再传递就没有乱码 <br> http://www.iiwnet.com/javascript/844.html <br> <div class="blockcode"> <div id="code_N3V"><ol><li><script type="text/javascript"><li>string = encodeURIComponent(string);<li>location.href = index.php?keyword='+string;<li></script></li></ol></div> <em onclick="copycode($('code_N3V'));">复制代码</em> </div> <div class="blockcode"> <div id="code_DgP"><ol> <li> <?php <li>$keyword = (isset($_GET['keyword'])) ? $_GET['keyword'] : '';</li> <li>?></li> </ol></div> <em onclick="copycode($('code_DgP'));">复制代码</em> </div> </td></tr></table> <div id="comment_34817" class="cm"> </div> <div id="post_rate_div_34817"></div> <br><br>