I have a csv file. I need to read and format in array to be import. My header are look like this,
Array
(
[0] => id
[1] => name
[2] => shortDescription
[3] => description
[4] => productType
[5] => sku
[6] => styleCode
)
And my values are look like this,
Array
(
[0] => Array
(
[0] => 185
[1] => T-shirts
[2] => this is tshirt short desc
[3] => This is tshirt desc
[4] => simple
[5] => 4585
[6] => 5292++
)
[1] => Array
(
[0] => 186
[1] => test name
[2] => test short desc
[3] => test desc
[4] => configurable
[5] => 525
[6] => 555
)
)
Here I need to replace every key of my values corresponding header values. So my final array should be like this,
Array
(
[0] => Array
(
[id] => 185
[name => T-shirts
[shortdescription] => this is tshirt short desc
[description] => This is tshirt desc
[producttype] => simple
[sku] => 4585
[stylecode] => 5292++
)
[1] => Array
(
[id] => 186
[name] => test name
[shortdescription] => test short desc
[description] => test desc
[producttype] => configurable
[sku] => 525
[stylecode] => 555
)
)
I cannot find out good solution for this. Ca anybody help me to sort this out ?
array_combine