php - How to add Tabs and Line Breaks from Array using file_put_contents -
i connecting sqlite database. use following query results:
$db = new sqlite3('sshtunnel.sqlite'); $results = $db->query('select * tunnel');
now, want add tabs , line breaks row array using file_put_contents
in php:
while ($row = $results->fetcharray(sqlite3_assoc)) { file_put_contents($file, $row, file_append).php_eol; }
the results displayed unformatted in 1 line:
testtesttest test test test
i wish have structure:
test test test test test test
where mistake?
while ($row = mysqli_fetch_row($results)) { foreach($row $value) { $value .= '|';//use ever char append file_put_contents($file, $value, file_append | lock_ex); } file_put_contents($file, '\n', file_append | lock_ex); }
Comments
Post a Comment