PHP: My object isn't being treated as an array when is_array says it is one.
Go to solution
Solved by Cruorzy,
If it gives an array you should give the values of the array to the csv with a foreach statement.
I never worked with the fputcsv function but according to w3schools it should be something like this.
$file = fopen("contacts.csv","w");
foreach ($data_array as $line)
{
fputcsv($file, $line);
}
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now