Question

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 ();

No correct solution

OTHER TIPS

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

You're missing a $ sign, try this:

$customerName = $dom -> get_elements_by_tagname ("item");
$customernameValue = $customerName[0] -> first_child() -> node_value ();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top