我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

用特殊字符替换字符串

I am trying to pass id=%ADD_CODE as url params but when I am trying to get in php it is replacing %a with �. I need to keep the url param values the way it is.

Example

http://localhost/detect.php?id=%ADD_CODE%SUBID1&cid=%COOKIEID

Result when I am trying to echo key and value

id �DD_CODE%SUBID1
cid %COOKIEID

Any ideas?

Use Urlencode

localhost.com/detect.php?id=urlencode($userinput)

Make sure you are using urlencode() on your parameters:

http://ca2.php.net/urlencode

近期文章

  • PHP通过文本框访问数据库
  • PHP使用父数组包装数组
  • 使用ajax添加和删除评论?
  • 如何在sprintf中放置条件
  • 带有下划线字符的Concat希伯来语字符
  • Paypal API将访问令牌返回为Null
  • 访问Symfony2中的后台进程
  • $ _SESSION变量在$ GLOBALS中不可见
  • PHP没有foreach操作数组
  • Yii2:MongoDB选择跳过大值
  • 在PHP Mysql中下载完整大小的文件
  • 使用YII Framework选择2 ajax选项
  • 这个PHP代码在这里发生了什么[关闭]
  • MySQL将值插入错误的列
  • 禁用Doctrine外键约束
  • 如何将.txt文件上传到数据库?
  • onResize()在WordPress 4.7.2中不起作用
  • yii2 dataprovider获取所有过滤后的数据
  • 坚持安装php7.0-zip扩展
  • 使用PDO插入postgres数据库

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华