douxie7339 2015-09-30 15:20
浏览 224
已采纳

用符号替换%26

Every piece of research I look up refers to replacing the ampersand with %26, when in fact I want to replace %26 in the URL with the ampersand.

At the moment each time I pass the url under the GET command I get %26 back.

For example the code I am passing in the form is as follows

    <form method="get" action="<?php echo $SERVER['PHP_SELF'];?>">

    <input type="text" id="stg" name="stg" size = "25" value="<?php echo '?pn=' . $sub1 .'%26'.$jrny.'&Subject='.$Subject.'&pn2='.$sub1. '&arc='.$sess.'&Table_Id='.$Table_Id; ;?>" />

When I try string replace or rawurlencode functions I still end up with %26. What am I doing wrong?

Thanks

  • 写回答

1条回答 默认 最新

  • dopuz8728 2015-09-30 15:24
    关注

    You can use the urldecode function:

    print_r(urldecode ( "%26" ));
    

    will print out:

    &
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法