b0y-101 Mini Shell


Current Path : E:/www/b-group.old/spfin - Copy/QRTRAN/report/
File Upload :
Current File : E:/www/b-group.old/spfin - Copy/QRTRAN/report/open.php

<?php
$myfile = fopen("BPQR_210910.txt", "r") or die("Unable to open file!");
// Output one line until end-of-file
$members = array();
while(!feof($myfile)) {
  //echo fgets($myfile) . "<br>";
  $members[] = fgets($myfile);	
}
fclose($myfile);
var_dump($members);

$myfile1 = fopen("BPQR_210910.txt", "r") or die("Unable to open file!");
// Output one line until end-of-file
while(!feof($myfile1)) {
  echo fgets($myfile1) . "<br>";
}
fclose($myfile1);


// (A) FILE TO ARRAY
$array = file('BPQR_210910.txt');
echo count($array);
echo count($array,1);
print_r($array);
 
// (B) ADDITIONAL OPTION - SKIP EMPTY LINES
$array = file('BPQR_210705.txt', FILE_SKIP_EMPTY_LINES);
print_r($array);

?>

Copyright © 2019 by b0y-101