【问题标题】:Undefined Index in PHP Code [duplicate]PHP代码中的未定义索引[重复]
【发布时间】:2016-12-23 19:40:08
【问题描述】:

我在这行代码中遇到一个未定义的索引错误:

switch ($_REQUEST["___p"])

我想我需要声明变量。我会将上面的行更改为什么?

【问题讨论】:

  • 嗨@u_mulder,节日快乐:]
  • 只是get或者post数组里面没有这样的索引

标签: php variables indexing undefined


【解决方案1】:

要么使用isset() 事先确保存在,要么直接忽略它:

switch (@$_REQUEST["___p"])

【讨论】:

    猜你喜欢
    • 2011-08-06
    • 1970-01-01
    • 2011-06-18
    • 2014-01-27
    • 2016-06-19
    • 1970-01-01
    • 2013-06-14
    • 1970-01-01
    相关资源
    最近更新 更多