hi everyone,

I want to find the character count of a document file.I used the code below.

$lines = file('E:/FILELIST.DOC');
$tot=0;
foreach ($lines as $line_num => $line)
{
echo $line_num."=".$line."<br>";
$tot=$tot+strlen($lines[$line_num])-2;
}
echo $tot;

This code worked correctly at first.But now i got the ouput like this.
0=ÐÏ*¡±á>þÿ 35ÿÿÿÿ Code guru   (i have deleted the remaining symbols and characters bcoz it is too long).
The count shown is28648 .actual character count is 8.

why does this happen?is anyother way to find the charater count?