Skip to content
Advertisement

PHP: Invalid argument supplied for foreach() while dynamic data Export?

Getting error while Printing dynamic data in phpexcel – Error Invalid Argument while printing data from my MYSQL Database

JavaScript

My Var_dump($labels) output is

JavaScript

I Added my Whole Code Please Once Please

it is giving invalid argument error

Advertisement

Answer

As mentioned in the comments, $labels[0] is not an array, $labels however is.

Change:

JavaScript

To:

JavaScript

Further reading.


Expanding based on your comments:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement