I have a large text file full of line breaks, and I want to be able to import the entire file as though it were a single string, strip it of all line-breaks and then add different ones back in.
But how do I read the file in? I tried using this kind of thing:
Code:
$fcontents = file("file.txt");
while (list ($line_num, $line) = each ($fcontents))
{
But I can't remove the line breaks, as though they're "hard" breaks that aren't actually part of each line.
What can I do about this?