Deserializing XML array

眉间皱痕 提交于 2019-12-06 13:18:30

You can use $serializer->deserialize($rawXml, 'array', 'xml') by adjusting xml structure (result and entry are default values). There is 4th parameter in deserialize - $context it can redefine default values, but i can not find the way how.

<result>
    <entry>
        <account_code>1</account_code>
        <state>active</state>
        <username nil="nil"></username>
        <email>verena@exampl.com</email>
        <first_name>Verena</first_name>
        <last_name>Example</last_name>
    </entry>
    <entry>
        <account_code>1</account_code>
        <state>active</state>
        <username nil="nil"></username>
        <email>verena@exampl.com</email>
        <first_name>Verena</first_name>
        <last_name>Example</last_name>
    </entry>
</result>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!