search

Home  >  Q&A  >  body text

php - xml data cannot be var_dumped?

I looked at the WeChat payment document demo and converted the array into xml data
But when I print var_dump() or echo it all turns into numbers.
Does anyone know how to deal with it?
Data before conversion

After conversion, it becomes a number....

代言代言2712 days ago1098

reply all(3)I'll reply

  • 仅有的幸福

    仅有的幸福2017-06-20 10:09:51

    Right click->View source code, the browser parses the xml tag as an html tag

    Or specify the document type as XML

    header("Content-Type:text/xml; charset=UTF-8");

    reply
    0
  • 某草草

    某草草2017-06-20 10:09:51

    You need to add a header tag when printing xml,

    header("Content-Type:text/xml;charset=utf-8");

    reply
    0
  • 三叔

    三叔2017-06-20 10:09:51

    This is an object. Do you want to insert the parameters of the object into xml? ? ?
    But I see that your code directly traverses the object and assigns it directly into xml...
    Should you convert the object into data first

    reply
    0
  • Cancelreply