How to convert Array to Array list for CSV export using FputCSV?

I need to convert an array with multiple results to a CSV file but am struggling to get a valid output . After some debugging I realized I am not generating a valid array list for fputcsv to iterate …

How to keep only a part of an explode of a csv column in php?

I have this php code that allows me to read a csv file and add 10 columns at the end to decompose the column $data[23]. This column contains for example : M6-Min Ord Qty 6,GO-Good Support,RP-Removable …

why there is an extra record stored in mysql database?

i created a csv to mysql database importer. Code- <?php include_once("connection.php"); if(isset($_POST["import"])){ $filename = $_FILES["file"]["tmp_name&…

Is it possible to count how many rows have an empty specified ‘cell’ or column in a csv?

I have a changing csv file that looks something like the following. I am trying to find out how I can count how many jobs have not been completed yet (have an empty field) CSV example: id,job_name,…

How to improve the speed of a for loop in PHP?

I have a CSV file with different lines: ;0;1;0;4;5;M;468468;A1101;0090 0;1;0;4;5;M;468468;A1108;0090 And in a folder of photos that must have the naming format “A1101_0090-1.JPG” for the …

How to create download popup (headers) for csv file with file_put_contents php

I was wondering if someone could give me some pointers on how to create a download popup as well as a location for the user to save it. So when they click on my “Download as CSV” button, it’…

How to update a database using php by uploading a CSV file?

I have some code here to update my database based on two columns in the CSV. The CSV file would look like this: ID Response 1 Hello1 2 Hello2 3 Hello3 In my database I have a table that also …

CSV Wrong Encoding

I have an array composed by just numbers and I use the following script to export in CSV

Add headers to CSV file via PHP

I have the following PHP script for creating CSV and collecting data from HTML form to CSV file, but I can’t add headers to the first row of CSV file. I’m a newbie in PHP world so I’ll appreciate if …

Import CSV/Excel data into MYSQL database and remove duplicate using codeigniter

Today i came across a functionality where i need to import the CSV/Excel file in to MYSQL database via codeigniter. There is a special requirement from client where he can upload the CSV/Excel file in …