if (move_uploaded_file($uploadData['tmp_name'], $uploadPath)) {
$files = fopen($uploadPath, 'r');
while (($line = fgetcsv($files, 0, ",")) !== FALSE) {
//$line = array_combine($line,$line); try but not working
pr($line);
}
}
I am getting output like that -
Array
(
[Company Name] => Company Name
[Primary First] => Primary First
[Primary Last] => Primary Last
)
Array
(
[0] => Naturfrisk Energy Bar
[1] => Aksel
[2] => Romer
)
Array
(
[0] => The Code Devloper
[1] => vikas
[2] => Tyagi
)
But i need Output like that-
Array
(
[Company Name] => Company Name
[Primary First] => Primary First
[Primary Last] => Primary Last
)
Array
(
[Company Name] => Naturfrisk Energy Bar
[Primary First] => Aksel
[Primary Last] => Romer
)
Array
(
[Company Name] => The Code Devloper
[Primary First] => vikas
[Primary Last] => Tyagi
)