Forum Moderators: coopster
$content = str_replace("<li>\n",'',$content);If you need to check for different forms of the newlines or multiples, you should probably use a regular expression and preg_replace() [php.net].
Unix/Linux system:
$content = str_replace("<li>\n",'',$content); Windows system:
$content = str_replace("<li>\r\n",'',$content); Perhaps there are spacebars following the <li> and before the newline, i.e.
<li> \n? If this is the case, you'll want to use preg_replace() instead (or you could go line by line and use trim(), but that's too tedious): Unix/Linux:
$content = preg_replace("/<li>\s*\n/",'',$content); Windows:
$content = preg_replace("/<li>\s*\r\n/",'',$content); On Windows servers, a newline is a combination of a carriage return (
\r) and a newline (\n). I'm wondering what you are doing with this, too:
$content = str_replace("\n","<li>",$content); It seems to be inserting an empty
<li> everywhere there's a newline. Is that useful to you?
thanks for all the replies btw