Forum Moderators: coopster
How can I strip new lines from html code? E.g. I've got a parameter $g which holds the value "
blabla
" and I want to strip all the new lines from this parameter. The value of this parameter was fetched from a html page.
Thx, Turbo
On a Windows system, try:
$g = str_replace("\r\n","",$g);
On a Linux/Unix system try:
$g = str_replace("\n","",$g);
Or, to replace the newlines with the word "fudge" on a *Nix system:
$g = str_replace("\n","fudge",$g);
... I think you get my drift ... :)
So I use this:
$data=str_replace("\r","",$data); $data=str_replace("\n","",$data);