|
-
May 20th, 2006, 03:53 AM
#1
character count
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|