I have a .csv file, and when I open it through notepad, it looks like this:
ID501501503502
And when I print it in the browser via php, it looks like
ID 501 501 503 502
My code is:
$handle = fopen("MonC1.csv", "r"); $data = fgetcsv($handle, 0); $fh = fopen('php://output', 'w'); if (! empty($data)) { foreach ($data as $item) { echo $item."<br>";
So basically the br tag inside the for loop does not work. This is my first problem.
And the second problem, even if I use fputcsv(now it is turned off) , it does not create the actual csv file.
Now I have a question, why doesnβt it have a place in the notebook, and when I type in the browser, does it get a space?
I have only one column and nothing else.
Any help is greatly appreciated. Thanks in advance.
source share