Say I have this following XML structure:
some value<
Variant for xpath (Also how to get content of node having dashes in name):
some value another value
$xml = simplexml_load_string($content); $node_value= (string)$xml->xpath('parent/child-1')[0];
result of $node_value:
"some value"