View Single Post
Old 08-29-2009, 05:37 PM  
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by xxweekxx View Post
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.
__________________

Last edited by GrouchyAdmin; 08-29-2009 at 05:38 PM.. Reason: It's just really ugly.
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote