Getting actual value from PHP SimpleXML node [duplicate]

Cast as whatever type you want (and makes sense…). By concatenating, you’re implicitly casting to string, so

$value = (string) $xml->someNode->innerNode;

Leave a Comment