Why does is_array() return false?

I have this SimpleXML object:

object(SimpleXMLElement)#176 (1) {
 ["record"]=>
 array(2) {
  [0]=>
  object(SimpleXMLElement)#39 (2) {
     ["f"]=>
     array(2) {
       [0]=>
       string(13) "stuff"
       [1]=>
       string(1) "1"
     }
  }
  [1]=>
  object(SimpleXMLElement)#37 (2) {
    ["f"]=>
    array(2) {
      [0]=>
      string(13) "more stuff"
      [1]=>
      string(3) "90"
    }
  }
}

Why does is_array($object->record) return false? It clearly says it's an array. Why can't I detect it using is_array?

Also, I am unable to cast it as an array using (array) $object->record. I get this error:

Warning: It is not yet possible to assign complex types to properties

Answers


SimpleXML nodes are objects that can contain other SimpleXML nodes. Use iterator_to_array().


Need Your Help

How can i get images from RSS feed in wordpress?

php wordpress rss

$ch = curl_init("http://runap.app.com/feed");

Center a hyperlink inside li element in navigation bar

css hyperlink navigation

I want to create a navigation bar where the text is centered, but my CSS code places the hyperlink at the top corner of the li as seen in the image.