Question : very simple and URGENT. php file manuplation

hi there

why below code display only first line on txt file.? and how can I explode content of file ?


<?php

    $file=fopen("PHP.txt","r")or exit("Can't open");

    if(!feof($file)){

        while($string=fgets($file)){
      list($st)=explode("&%&",$string);
           echo " $st <br>";

}
  fclose($file);
}
 
?>

best regars.

Answer : very simple and URGENT. php file manuplation

Your 'while' loop doesn't work.  Try this.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
<?php

$file=fopen("PHP.txt","r")or exit("Can't open");

while(!feof($file)){
   $string=fgets($file)
   list($st)=explode("&%&",$string);
   echo " $st <br>";
}
fclose($file);
 
?>
Random Solutions  
 
programming4us programming4us