【发布时间】:2012-11-14 09:07:10
【问题描述】:
可能重复:
PHP: “Notice: Undefined variable” and “Notice: Undefined index”
Undefined index in PHP
注意:未定义索引:第 107 行 C:\xampp\htdocs\pmsx\lib\config.php 中的 NAME
这是确切的错误。这是我在文件上的代码。谢谢你的帮助。
这是我的第 107 行:
//echo "<br>" . $cdata;
// create the proper tree node if NAME attribute is set
if ($this->attr["NAME"] != "")
$this->tags[count($this->tags) - 1] = $this->attr["NAME"];
【问题讨论】:
-
这与 sql 到底有什么关系?听起来更像是一个 DOM 操作。你检查过你所在的节点是否有
NAME属性? -
你能给出
var_dump($this->attr);的输出吗? -
fwiw,你的第二行可以简化
$this->tags[] = $this->attr["name"]; -
@ScottEvernden,据我所知,原行覆盖了最后一个元素,而你的则添加了。不过,看起来原始行只是有一个错误。
标签: php