Link to home
Start Free TrialLog in
Avatar of prowebinteractiveinc
prowebinteractiveinc

asked on

checking for xml tag name exists in PHP

I want to check if certain tags exist in xml
example:
$data = $xmlString;
$xml = simplexml_load_string($data);
//  does $xml->xxxName exist the do something
$customerName = $xml->xxxName;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Hugh McCurdy
Hugh McCurdy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If this is a follow-on from your earlier question that had invalid XML, you would want to start by loading the XML, then testing to see if the object existed or if the SimpleXML_Load_xxx() returned FALSE. Just a thought... ~Ray