【发布时间】:2017-07-02 15:52:26
【问题描述】:
如果我的当前 URL 包含此文本 special_offer=12,我如何在 PHP 中识别。
例如,如果我的域 URL 是 http://www.example.com/newproducts.html?special_offer=12,则回显一些内容。
或者,域可以是http://example.com/all-products.html?at=93&special_offer=12
此文本将始终相同:special_offer=12。
【问题讨论】:
-
使用
!empty().. 检查special_offer参数var 是否为== 12., bcozisset()也接受空值,所以在这种情况下isset()失败!!
标签: php if-statement url query-string isset