English 中文(简体)
在节点中用 DomDocument 断线
原标题:Linebreak with DomDocument in a node

我在php中创建 DOMDocument 类的 xml 文件。 我想为我的地址做块节点, 像这样 :

<Address>CompanyName
Street
Place</Address>

我必须创建像这样的地址字段, 因为 xml 是由其他人导入的 。

I already tried " ", "cdata", "< br >" but its also printed. Is there any way to make a line break with DOMDocument in an xml without any additional text?

或者还有其他更好的方法吗? (XMLWriter? )

感谢您的帮助。

edit: if i open it in firefox, it looks like this:

最佳回答

它实际上工作得很好。在您的互联网探索者中,右键点击页面,然后单击“查看源 ” 。 新行就在那里 。

问题回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签