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.
Related Contents:
- How to convert array to SimpleXML
- Reference – How do I handle Namespaces (Tags and Attributes with a Colon in their Name) in SimpleXML?
- Parse XML with Namespace using SimpleXML [duplicate]
- Accessing @attribute from SimpleXML
- Remove a child with a specific attribute, in SimpleXML for PHP
- SimpleXML: Selecting Elements Which Have A Certain Attribute Value
- Simple XML – Dealing With Colons In Nodes
- Get value from SimpleXMLElement Object
- How to use XMLReader in PHP?
- Forcing a SimpleXML Object to a string, regardless of context
- PHP simpleXML how to save the file in a formatted way?
- How to get the value of an attribute from XML file in PHP?
- Implementing condition in XPath [duplicate]
- parse an XML with SimpleXML which has multiple namespaces [duplicate]
- PHP namespace simplexml problems
- SimpleXML – Remove xpath node
- Error: “Input is not proper UTF-8, indicate encoding !” using PHP’s simplexml_load_string
- SimpleXML and print_r() – why is this empty?
- Using SimpleXML to create an XML object from scratch
- PHP library for parsing XML with a colons in tag names? [duplicate]
- How to write CDATA using SimpleXmlElement?
- PHP SimpleXML get innerXML
- simplexml error handling php
- Using SimpleXML to read RSS feed
- PHP SimpleXML: insert node at certain position
- Accessing @attribute from SimpleXML
- How can I set text value of SimpleXmlElement without using its parent?
- What’s the difference between PHP’s DOM and SimpleXML extensions?
- Best way to process large XML in PHP [duplicate]
- ‘xmlParseEntityRef: no name’ warnings while loading xml into a php file
- Getting actual value from PHP SimpleXML node [duplicate]
- Get root node of XML doc using simplexml
- Updating XML node with PHP
- SimpleXML how to prepend a child in a node?
- Getting the text portion of a node using php Simple XML
- php SimpleXML attributes are missing
- PHP – Processing Invalid XML
- PHP get values from SimpleXMLElement array
- SimpleXML: Working with XML containing namespaces
- Using SimpleXML to load remote URL
- Loop through an XML object with SimpleXML
- PHP convert XML to JSON group when there is one child
- Create subdomains on the fly with .htaccess (PHP)
- Can PHP cURL retrieve response headers AND body in a single request?
- String with array structure to Array [duplicate]
- How to merge transparent PNG with image using PHP?
- Authentication on google: OAuth2 keeps returning ‘invalid_grant’
- How to decode eval( gzinflate( base64_decode(
- Calculate the number of months between two dates in PHP?
- PHP json_encode json_decode UTF-8