2

how to get SimpleXMLElement Object to array in PHP my SimpleXMLElement Object response code is

Array
(
    [error_code] => SimpleXMLElement Object
        (
            [0] => 160040
        )

    [error_msg] => SimpleXMLElement Object
        (
            [0] => 验证码超出同模板同号码天发送上限
        )

    [smsMessageSid] => 
)
  • You can just access the items using `$xml->error_code` and `$xml->error_msg` with whatever your SimpleXML variable is called instead of `$xml` – Nigel Ren Nov 28 '18 at 10:22
  • look at https://stackoverflow.com/questions/2726487/simplexmlelement-to-php-array – FatFreddy Nov 28 '18 at 10:22
  • You've tagged your question with `json` - is this actually about how to convert a SimpleXML object to JSON? – iainn Nov 28 '18 at 10:24

0 Answers0