Well, chalk it up to stubborness or something but I finally got it to work! 🙂
I had to rewind the file pointer, something I didn't think of before.
Ah well, here's the final code if anyone is interested.
$dir = "../files/13000";
$blah = opendir($dir);
while (false !== ($file = readdir($blah))) {
if($file == "." || $file == "..")
{
}
else
{
$path = $dir . "/" . $file;
echo $path;
$fp = fopen($path, "r+");
$contents = fread($fp,filesize($path));
rewind($fp);
$wrap = fwrite($fp,wordwrap($contents),strlen($contents));
}
}