Problem with reading file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Boer
Forum Newbie
Posts: 2
Joined: Wed Jul 03, 2002 5:38 am

Problem with reading file

Post by Boer »

When I want to retrieve all information stored in this file part of the contents of this file is not shown. Here is the PHP I use to read the file:
<?
$datei = fopen($file,"r");
while (!feof($datei)) {
$zeile=fgets($datei,4096);
$zeile=trim($zeile);
$line = split("[\r]", $zeile);
for ($q=0; $q<count($line); $q++) {
$line[$q]=trim($line[$q]);
//here some information vanish
echo $line[$q]. "<br>";
$result = split("[ ]",$line[$q]);
$ID = $result[0];
$value = $result[1];
?>

I think my problem has something to do with the file itself... Suggestions??
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

What does the output look like?

Mac
Boer
Forum Newbie
Posts: 2
Joined: Wed Jul 03, 2002 5:38 am

Post by Boer »

Not good :wink:
Some of the information in the file get printed, but the most is gone..

You can try it yourself using the file in the first post. Look at the file using (note- or) wordpad and you will see how different the output is....
Post Reply