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

在PHP中将'%23'转换为'#'

URL: example.com/search:#searchWord

Since the # is not send to the server, it is changed to %23.

In the search page I want to display

Results for: #searchWord

But what I get is %23searchWord. I tried htmlspecialchars(), but nothing happens.

To achieve your goal use urldecode.

echo urlencode('example.com/search:#searchWord');
// output: example.com%2Fsearch%3A%23searchWord

echo urldecode('example.com%2Fsearch%3A%23searchWord');
// output: example.com/search:#searchWord

近期文章

  • 如果用户在30天内没有尝试登录,如何删除用户
  • php自我提交和记录更新
  • 如何在PHP5中创建子类中的变量
  • Php file_get_contents()问题
  • 使用preg_match正则表达式PHP解析HTML [重复]
  • MySQL查询订单记录ORDER BY
  • 如何在php中获取最大日期数据
  • Ucfirst返回不正确的结果
  • 未定义的索引通知
  • 另一个就地编辑器 - 一个jQuery编辑就地插件
  • Zend Framework _forward不起作用
  • 在特定日期执行SQL查询
  • 无法理解PHP代码示例
  • PHP函数一见即可返回不同的多值,但不能
  • 为什么我的Code Igniter控制器出现意外的T_VARIABLE错误?
  • 在这个javascript代码中包含变量的正确语法是什么?
  • PHP语法中的“\”实际意味着什么?
  • Regex_match用于验证来自codeigniter中选择框的g字符串
  • HTML通过PHP解析器
  • PHP null var存在[重复]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华