Need to include <BR> in php to xml script.
Posted: Mon Aug 11, 2014 7:05 am
Hi folks I have a php script running on a cron job that produces a xml file from the data in my MySQL database, its all working great but I would like to include the line breaks that appear in the data field Bullet1. The code below works fine but outputs all the text straight after each other.
$xml .= "<Features><![CDATA[".$r["Bullet1"]."]]></Features>";
or
$xml .= "<Location>".$r["NearestTown"]."</Location>";
I am trying to use this type of code to add a <BR> but its not working any help would be appreciated.
$xml .= "<Features><![CDATA[".stripcslashes(ereg_replace("(\r\n|\n|\r)", "<br />".$r["Bullet1"]))."]]></Features>";
or
$xml .= "<Location>".stripcslashes(ereg_replace("(\r\n|\n|\r)", "<br />".$r["Bullet1"]))."</Location>";
Steve
$xml .= "<Features><![CDATA[".$r["Bullet1"]."]]></Features>";
or
$xml .= "<Location>".$r["NearestTown"]."</Location>";
I am trying to use this type of code to add a <BR> but its not working any help would be appreciated.
$xml .= "<Features><![CDATA[".stripcslashes(ereg_replace("(\r\n|\n|\r)", "<br />".$r["Bullet1"]))."]]></Features>";
or
$xml .= "<Location>".stripcslashes(ereg_replace("(\r\n|\n|\r)", "<br />".$r["Bullet1"]))."</Location>";
Steve