Quote:
Originally Posted by xxweekxx
tried that..
|
That one was the joke.
This one works though:
Code:
<?php // PHP4monkeyz
$l = file('file');
$n='';
foreach ($l as $ln => $line) {
echo "Doin da line #{$ln}.\n";
$n .= rtrim($line) . "lolsox" . "\n";
}
$f = fopen('file.new', 'w');
if (!$f) {
die("I can't be writin no files mothafuccka.\n");
} else {
$b = fwrite($f, $n);
fclose($f);
echo "I done writ ". ($b/1024) . "kB, yo.\n";
}
?>
This is still godawful code, but it works. Again, It
was a joke.
