I am using a form to submit a list of items that I want to save to a config text file, but these list items should all be on the same line of the text file. Every time PHP breaks apart and puts the list items into the file, however, it automatically adds a new line before the </li>
tag. Why? How do I prevent this.
CODE:
$pro = explode("
",$_POST["pro"]);
$proo = "<ul>";
for($index=0; $index<count($pro);$index++)
{
$proo .= "<li>";
$proo .= $pro[$index];
$proo .= "</li>";
}
$proo .= "</ul>";
$proo = str_replace("
","",$proo);
Edit 1
If I echo $proo
into the webpage, it looks like this:
<ul><li>List Item 1
</li><li>List Item 2
</li><li>List Item 3
</li><li>List Item 4
</li><li>List Item 5</li></ul>
Why are there line breaks before each </li>
?
Somewhere in there, it's adding new lines...
Thanks!
David