help with matrix in laravel 5.4

0

Hi, I have the following error with laravel 5.4 when I create an array to add elements and display them in a table this is the code:

When I click on add it tells me the following:

I do everything with ajax but it does not let me create the matrix. Someone could help me. I would be grateful

    
asked by Flaying Zork 04.11.2017 в 15:29
source

1 answer

1

Basically, what you did is create an offset with the array type, which is illegal. You can only have offsets of type string and integer.

Example:

$array = array();
=> []
$counter = array();
=> []
$array[$counter] = 'test';
PHP Warning:  Illegal offset type on line 1

First you have:

$acumulador = array();

and then you have

$acumulador++; 

I recommend you initialize your variable $acumulador to a whole number.

$acumulador = 0;
    
answered by 06.11.2017 в 01:34