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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -