dongtan9465 2012-03-27 11:12
浏览 61
已采纳

需要在每个xml元素后添加回车符(php)

I have a file that is sent over https and I am handling with a php script.

The data is accepted using:

$data = file_get_contents('php://input')

If written to a file it is written as one line.

Due to our internal systems (IBM power 7) I'm told by I.T that I need to add a carriage return after each xml element.

So the file currently opens in an editor as :

<root><element1><element2></element2></element1></root>

I need it to be :

<root>
<element1>
<element2></element2>
</element1>
</root>

Which requires inserting " " after each closing tag and a tag with children.

Any ideas?

  • 写回答

2条回答 默认 最新

  • dongxi5494 2012-03-27 11:41
    关注

    The formatOutput option will do it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 Pytorch深度学习服务器跑不通问题解决?
  • ¥15 部分客户订单定位有误的问题
  • ¥15 如何在maya程序中利用python编写领子和褶裥的模型的方法
  • ¥15 Linux权限管理相关操作(求解答)
  • ¥15 Bug traq 数据包 大概什么价
  • ¥15 在anaconda上pytorch和paddle paddle下载报错
  • ¥25 自动填写QQ腾讯文档收集表
  • ¥15 DbVisualizer Pro 12.0.7 sql commander光标错位 显示位置与实际不符
  • ¥15 android 打包报错
  • ¥15 关于stm32的问题