I need to pick out the child node of "request." That node name, which is "send" in this example, can be one of four or five different names, like "groups," "join," etc. I've tried using this code to pick out the "send" node name:<?xml version="1.0" encoding="UTF-8"?><request account="xxxxx" password="xxxxxx"><send param1="test" param2="ececececec" /></request>
Code: Select all
function getCommandReq($req)
{
$result = $req->xpath('/request/*');
$reqCommand = (string) key($result[0]);
echo '***REQUEST COMMAND: ', $reqCommand, '***';
}Code: Select all
***REQUEST COMMAND: @attributes***