Reputation: 783
How do I get the values of the follow array fields in php? When I do a print_r function on a two dimensional array, I get the following result:
[title] => SimpleXMLElement Object ( ) [date] => SimpleXMLElement Object ( )
How do I get the string value of title and date? I've tried casting them with
(string)
, however this didn't work.
Upvotes: 0
Views: 563
Reputation: 713
You need to access the attributes of the SimpleXMLElement Object. Say you have an instance named entry with child title you type
(string) $entry->title;
Upvotes: 1