mardi 14 février 2017

new line problems when parsing xml

I use an xml upload option in my website, but the problem is that when I import I have all new lines are skiped and words are just sticking together, I use php, here is how I do xml to array:

$listings = Parser::xml($xml)['Listing'];

here is how I save the text:

foreach ($listings as $item) {
    $listing->description = e(strip_tags ($item ['Web_Remarks']));
    $listing->save();
}

e() is laravel function to escape before saving to DB, strip_tags() - this function strips a string from HTML, XML, and PHP tags

here is the end result and as you can see the text is sicked together : http://ift.tt/2lLFGlf

so I need a way to have new lines in my text, pls help



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lFXhyX
via IFTTT

Aucun commentaire:

Enregistrer un commentaire