我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

asXML表现不正常

I may be missing something really obvious but this

<?php
$string = <<<XML
<a>
 <b>
  <c>text</c>
  <c>stuff</c>
 </b>
 <d>
  <c>code</c>
 </d>
</a>
XML;

$xml = new SimpleXMLElement($string);

echo $xml->asXML();

is supposed to output the below according to php.net.

<?xml version="1.0"?>
<a>
 <b>
  <c>text</c>
  <c>stuff</c>
 </b>
 <d>
  <c>code</c>
 </d>
</a>

Not the case, it is, in fact, outputting the below (for me at least). Does anyone have any ideas?

text stuff code

近期文章

  • Laravel cron入口不能反复运行
  • SAP CO88报错:期间 007 2019 结算之后,状态 GIFT/TABG 被冲销
  • 如何将我的sql输出显示到php?
  • 使用Bootstrap Modal进行Laravel验证
  • 用于复杂XML请求的PHP SOAP客户端
  • PHP选项卡分隔的内容无法被Excel识别
  • 在没有文件扩展名的php7中解析application / x-httpd-php
  • 使用phpmailer附加嵌入式图像时,Windows 7崩溃
  • 使用var_dump()在php中显示null
  • Laravel URL重定向
  • Vue.js Axios.post向php发送变量,但我无法访问这些变量
  • 我无法通过PHP-Curl发布和重定向到支付网关
  • 使用cpanel将图像显示到刀片
  • 使用jquery在for循环中延迟警报
  • .htaccess重写规则Case inSensitive / Ignore case in urls
  • PHP管理器检查phpInfo显示错误的版本
  • Paypal rest api多个账单协议
  • 从数据库中获取多个数据(或左右)
  • 如何使用JavaScript在mysql数据库上播放多个音频文件
  • 找不到“Tymon \ JWTAuth \ Providers \ LaravelServiceProvider”类

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华