Press enter to see results or esc to cancel.


Writing 10 Million rows to a text file using PHP

In this video I have shown how you can create a text file with 10 million rows in that using PHP.
This example is shown in a XAMPP server.
Below given code will create the file.


<?php
header("Content-Type: text/plain");
header('Content-Disposition: attachement; filename="jinujawad.txt"');

for ($x = 0; $x <= 1000000; $x++) {
echo "The number is: $x \n";
}
?>Hello jinu jawad.com
this is text file
created from
browser

The file created will look like the below one.


Tags

Comments

Leave a Comment