dsd30433 2012-05-27 19:34
浏览 40
已采纳

将日文字符传递给PhP文件

I make a simple PhP program

<?php

echo $_GET['ID'];
?>

Then I call

http://localhost/testGetID/?ID=%E6%AD%A4%E5%8E%9F%E7%90%86%E6%98%AF%E5%9C%A8

This is what I got: 此原ç†æ˜¯åœ¨

What should I do so I show up actual chinese characters? The chinese characters will be ID for my databases by the way.

  • 写回答

2条回答 默认 最新

  • dongxiejie9387 2012-05-27 19:39
    关注
    1. add this line to your <head></head> section <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    2. use urldecode() or mb_convert_encoding() function

    3. encode the ID with base64_encode() and then decode it with base64_decode()

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用