I'm trying to use 'for loop' and write directly to csv without inserting into database and export as csv file.
<?php
require_once('function.php');
for ($i=0; $i < 6000; $i++) {
# code...
$colum1= generatePassword(5);
$colum2 = serial_number(5);
#write directly to csv file
}