Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?php
$db = array(
0 => array(
'row1' => 'content1',
'row2' => 'content2',
),
1 => array(
'row1' => 'content1',
'row2' => 'content2',
),
2 => array(
'row1' => 'content1',
'row2' => 'content2',
),
);
$content = "row1,row2\n";
foreach($db as $row) {
$content .= "{$row['row1']},{$row['row2']}\n";
}
$filename = "yourfile.txt";
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Length: ". strlen($content).";");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Type: application/octet-stream; ");
header("Content-Transfer-Encoding: binary");
echo $content;
<?php
$query = mysql_query('SELECT * FROM `table` WHERE ...');
$content = "row1,row2\n";
while($row = mysql_fetch_assoc($query)) {
$content .= "{$row['row1']},{$row['row2']}\n";
}
$filename = "yourfile.txt";
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Length: ". strlen($content).";");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Type: application/octet-stream; ");
header("Content-Transfer-Encoding: binary");
echo $content;