I have from an API-request an encapsulated Array like this:
Array
(
[1] => SimpleXMLElement Object
(
[id] => 1
[link_rewrite] => fashion-supplier
[name] => Fashion Supplier
[active] => 1
[date_add] => 2018-01-18 13:47:30
[date_upd] => 2018-01-18 13:47:30
[description] => SimpleXMLElement Object
(
[language] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[id] => 1
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[id] => 2
)
)
)
)
[meta_title] => SimpleXMLElement Object
....
This data I want to store in the Laravel-Cache. Because of the Simple-XML-Elements inside it is not possible to store the raw data ("Serialization of 'SimpleXMLElement' is not allowed").
Is there a way to convert this complex array-simplexml-object-combination in a storable form? The problem is, I need the XML-Attributes inside, that's why I can't use json_decode(json_encode($array));
Thank you for your help!
Alex