I am writing a series of variables to a text file. But the variables all seem to print (using fwrite()) with new lines embedded. I want the output to appear on a single line in the file.
Anyone know of a string function that will strip off any leading or trailing new line chars from a variable? Chop() and Trim() just take care of spaces.
You can make everything on a single line buy using ereg_replace. e.g.
ereg_replace( "\ n \ r", " ", $variable );
Though don't include the spaces between the \ n and \ r. That should work for you.