Slight problem. I need to strip out new lines between lines of text (in this case XML) - not a problem - however, if i do a replace on \n then it will destroy my formating of the XML, which of course i want to keep.
eg.
<device>
<header>
<Device_ID>00001</Device_ID>
</header>
<default>
<device>
<header>
<Device_ID>00001</Device_ID>
</header>
<default>
I need to get rid of the spaces in between the two device descriptions. Ideas?
Thanks in advance.
New Lines - and headaches!
Moderator: General Moderators
array_filter
Code: Select all
function filter_empty($s)
{
return ($s!="\n" && $s!="\r\n");
}
$xml = <string-array>
$xml = array_filter($xml);