Horje
How to extract first 100 records from a TXT file in PHP | PHP Tutorial Code
Follow the Example

index.php
Example: PHP
<?php
$start = 1; 
$end = 100;
$handle = fopen("file.csv", "r");
$i = 0;
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
if(($start <= $i) && ($i <= $end)) {

    
    echo $data[0];
    echo '</br>';
    
}
elseif($i > $end) {
    break;
}
$i++;
}

fclose($handle);
?>

Output should be:

How to extract first 100 records from a TXT file in PHP




Read Full::
PHP Extract Code
Category:
PHP Tutorial Code
Sub Category:
PHP Extract Code
Uploaded:
1 week ago
Uploaded by:
Admin
Views:
10
Tested on:
PHP 7

Related Articles
How to extract first 100 records from a TXT file in PHP

More Articles
How to get first Five Line from CSV File PHP Extract Code
How to get first 100 records from a csv file in PHP PHP Extract Code

Share on: