It might be better to wrap this in an isset()
if(isset($A->b->c)) { // c exists
That way if $A
or $A->b
don’t exist… it doesn’t blow up.
More Related Contents:
- How to convert array to SimpleXML
- Accessing @attribute from SimpleXML
- SimpleXML: Selecting Elements Which Have A Certain Attribute Value
- Get value from SimpleXMLElement Object
- How to use XMLReader in PHP?
- PHP simpleXML how to save the file in a formatted way?
- Implementing condition in XPath [duplicate]
- Error: “Input is not proper UTF-8, indicate encoding !” using PHP’s simplexml_load_string
- SimpleXML and print_r() – why is this empty?
- PHP SimpleXML get innerXML
- How can I set text value of SimpleXmlElement without using its parent?
- What’s the difference between PHP’s DOM and SimpleXML extensions?
- Accessing @attribute from SimpleXML
- Best way to process large XML in PHP [duplicate]
- Updating XML node with PHP
- SimpleXML how to prepend a child in a node?
- PHP – Processing Invalid XML
- How to Paginate lines in a foreach loop with PHP
- Using SimpleXML to create an XML object from scratch
- PHP SimpleXML Namespace Problem
- PHP get values from SimpleXMLElement array
- php SimpleXML attributes are missing
- edit XML with simpleXML
- converting SOAP XML response to a PHP object or array
- How do you rename a tag in SimpleXML through a DOM object?
- Format output of $SimpleXML->asXML(); [duplicate]
- adding a namespace when using SimpleXMLElement
- “At sign” @ in SimpleXML object?
- simple xml add namespaced child
- How to import XML string in a php DOMDocument