Horje
How to get first Five Line from CSV File

A small change to your code should read a maximum of five lines.


How to extract first Five Line from CSV File

Follow the Example.
index.php
Example: PHP
<?php
$maxLines = 5;
$file_handle = fopen("file.csv", "r"); // Here put CSV File Location

for ($i = 0; $i < $maxLines && !feof($file_handle); $i++)
{
    $line_of_text = fgetcsv($file_handle, 1024);
    print '<div class="ticker_price">'. $line_of_text[0] . "</div>";
}
fclose($file_handle);
?>

Output should be:

How to extract first Five Line from CSV File




Related Articles
How to extract Domain Name from Full URL in PHP PHP Extract Tutorial
How to extract only name from domain in PHP PHP Extract Tutorial
How to extract All url from a single page by PHP PHP Extract Tutorial
How to get first Five Line from CSV File PHP Extract Tutorial
How to get first 100 records from a csv file in PHP PHP Extract Tutorial
How to get meta Tag PHP Extract Tutorial
How to get title description image and multiple images from URL PHP Extract Tutorial

Single Articles
How to extract first Five Line from CSV FilePHP Extract Tutorial

Read Full:
PHP Extract Tutorial
Category:
Web Tutorial
Sub Category:
PHP Extract Tutorial
Uploaded:
3 months ago
Uploaded by:
Admin
Views:
3



Share on: