The example is shown with the help of XAMPP server installed in windows 10 PC.
The below code can be used to create a CSV file.
<?php
header("Content-type: text/plain");
header("Content-Disposition: attachment; filename=jinu.csv");
echo '"jinu","jawad","one","two"'."\n";
echo '"jinu","jawad","one","two"'."\n";;
echo '"jinu","jawad","one","two"'."\n";;
for ($x = 0; $x <= 100; $x++) {
echo '"'.$x.'","jinu","jawad"'."\n";
}
?>
No comments:
Post a Comment