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.

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
this is text file
created from

The file created will look like the below one.



Leave a Comment