【问题标题】:Getting issue in reading query string in php在 php 中读取查询字符串时遇到问题
【发布时间】:2014-11-13 10:52:13
【问题描述】:

我的网址格式如下

http://domain.com/redirect?url=http://thirdpartydomain.com?aff_id=4234324&url=http://storesite.com/list/page/1

这里我想获取第一个 url 键的值,即。

http://thirdpartydomain.com?aff_id=4234324&url=http://storesite.com/list/page/1

什么是最好的,

我已经尝试过建议的方法,但没有一个对我有用。

【问题讨论】:

    标签: php get query-string


    【解决方案1】:
    $UrlYouNeed = substr($originalURL, strpos($originalURL, "=") + 1); 
    

    【讨论】:

    • 也许$data$originalURL 应该是一样的吧?
    【解决方案2】:
    $your_string="http://domain.com/redirect?url=http://thirdpartydomain.com?aff_id=4234324&url=http://storesite.com/list/page/1";
    
    $your_string_explode=explode("http://",$your_string);
    
    echo $your_string_explode[1];  
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多