String problem
Posted: Fri May 26, 2006 10:04 am
I am trying to read a log file into a string and tokenize it to get a hold of the values i need. But when I try to print one or several pieces of the string it contains several question marks. Why is this happening?
Code: Select all
<?php
$filename = "c:\\apache\\Apache2\\htdocs\\test\\OISExport_Error.txt";
$handle = fopen($filename, "rb");
// $contents = fread($handle, filesize($filename));
if ($handle) {
$i = 0;
while (!feof($handle)) {
$buffer = fgets($handle, 512);
$pieces = explode(" ",$buffer);
echo $pieces[0] . "<br>";
}
fclose($handle);
}
?>