Laravel 5.5 : array_combine(): Both parameters should have an equal number of elements
I assume the problem might be last row.
You can verify what's the exact problem replacing:
$row = array_combine($header, $row);
with:
if (count($header) != count($row)) {
dd($header, $row);
}
And in your case after tracking the problem you can simple skip the row in such case for example like this:
if (count($header) != count($row)) {
continue;
}
Find the error that array_combine(): Both parameters should have an equal number of elements
Please try using array_merge()
instead. Hope this helps
Related Topics
How to Create and Store Md5 Passwords in MySQL
How to Get Email and Their Attachments from PHP
How to Access Magento User's Session from Outside Magento
How to Serve Documents from Outside the Web Root Using PHP
Oauth Implementation in Netsuite Using PHP
Yii2 Translation Does Not Work
Php: $_Get and $_Post in Functions
Checking If a Number Is Float in PHP
How to Reverse Order Output of a MySQL Query
Pdo Error: SQLstate[Hy000]: General Error: 2031