tags:

views:

38

answers:

1

When I try to access info that is not presented in xml like so: $someInfo = $element->blabla->cats[0]->src; PHP shows notice like this: Notice: Trying to get property of non-object How would I settle the matter?

A: 

Just check if the specific element is set befor accessing data:

if(isset($element->blabla->cats[0]->src)){
    $someInfo = $element->blabla->cats[0]->src;
}
Kau-Boy