i have been trying to write to a file, but i get indentation in the file. I can get rid of the ^M characters but it's all shifted and each entry is a line, rathar then each row is a line.
example:
1
Name
Team
State
example:
1
Name
Team
State
Code:
<?php
$file = file("[URL unfurl="true"]http://www.nfl.com/stats/categorystats?tabSeq=1&statisticPositionCategory=QUARTER[/URL]
//$file = file("[URL unfurl="true"]http://charon.cs.wau.edu/~pkioko/Fantasy_Football.html");[/URL]
//$file = file("[URL unfurl="true"]http://sports.yahoo.com/nfl/stats/byposition?pos=QB");[/URL]
$player_count = 1;
$newfile = "QB.txt";
$handle = fopen($newfile, 'w');
foreach ($file as $file_line => $files)
{
$files = strip_tags($files);
$chars = htmlspecialchars($files);
$chars = strval($chars);
$chars2 = explode(",", $chars);
$chars3 = $chars2[0] . $chars2[1];
if($file_line >= 1459 && $file_line <=11179 && $file !== " ")
{
//echo "Line #<b>{$file_line}</b> : " . htmlspecialchars($files) . "<br />\n";
if($chars3 == $player_count)
{
//echo "<br>\n";
$player_count++;
}
echo htmlspecialchars($files);
//fwrite($handle, $chars4);
}
}
fclose($handle);
?>