tags:

views:

79

answers:

2

In PHP I would like to get the text value of the customer name tag. I write this code but this does not work. Would you please help me with this? Thank you

$customerName = $dom->get_elements_by_tagname("item");
$customernameValue = customerName[0]-> first_child()->node_value ();
+9  A: 

I'm not familiar with the library you're using, but it looks like you simply missed the $ before customerName on the second line.

Aistina
+3  A: 

You're missing a $ sign, try this:

$customerName = $dom -> get_elements_by_tagname ("item");
$customernameValue = $customerName[0] -> first_child() -> node_value ();
paxdiablo