Skip to content

fromArray can only retrieve Array[0] into sheet, but this array contains 3 elements #2252

Answered by oleibman
Lydiachl asked this question in Q&A
Discussion options

You must be logged in to vote

First, you can make your code readable by placing ``` php before the code, and ``` after.
As for your problem, you can get the result you're looking for by replacing the following lines:

        if($CustomerA == null){
            $CustomerA = $rowData;
        } else {
            array_push($CustomerA,$rowData);
        }

with the following line:

        $CustomerA[] = $rowData[0];

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Lydiachl
Comment options

Answer selected by Lydiachl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants