【问题标题】:how to get complete value in a variable in the page url php如何在页面url php中的变量中获取完整值
【发布时间】:2020-09-20 18:39:17
【问题描述】:

我的页面中有这个网址

https://www.albaama.com/search.php?qry=Fashion%20&%20Clothing

我使用下面的代码来回显变量 'qry'

的值
<?php 
    if (isset($_GET['qry'])) {
        echo $_GET['qry'];
    } 
    else {
        echo "";
    } 
?>

但每当我回应它时,我只会得到时尚而不是时尚和服装。 请问我如何获得完整的价值?

【问题讨论】:

标签: php url get


【解决方案1】:

这个查询字符串:https://www.albaama.com/search.php?qry=Fashion%20&amp;%20Clothing

翻译成这样:

问题在于&amp;引入了一个second参数。

你需要urlencode()整个字符串“Fashion & Clothing”

【讨论】:

    猜你喜欢
    • 2014-10-14
    • 2019-03-25
    • 1970-01-01
    • 2022-01-25
    • 2010-09-07
    • 2011-05-13
    • 2011-01-15
    • 1970-01-01
    • 2011-10-09
    相关资源
    最近更新 更多