【发布时间】:2009-05-09 11:18:08
【问题描述】:
在 PHP 中,我想获取客户名称标签的文本值。我写了这段代码,但这不起作用。你能帮我解决这个问题吗?谢谢
$customerName = $dom->get_elements_by_tagname("item");
$customernameValue = customerName[0]-> first_child()->node_value ();
【问题讨论】:
在 PHP 中,我想获取客户名称标签的文本值。我写了这段代码,但这不起作用。你能帮我解决这个问题吗?谢谢
$customerName = $dom->get_elements_by_tagname("item");
$customernameValue = customerName[0]-> first_child()->node_value ();
【问题讨论】:
我不熟悉您使用的库,但看起来您只是错过了第二行 customerName 之前的 $。
【讨论】:
您缺少$ 符号,试试这个:
$customerName = $dom -> get_elements_by_tagname ("item");
$customernameValue = $customerName[0] -> first_child() -> node_value ();
【讨论】: