I have a string from the database that usually is something like this: 0,10,20,50,100,1000,30,55,90.
I do this:
$perfiles = collect(explode(',' , $Menu->perfil));
dump($perfiles);
$perfiles2 = $perfiles->flatten();
dump($perfiles2);
the output is this:
Illuminate\Support\Collection {#332 ▼
0 => "0"
1 => "10"
2 => "20"
3 => "50"
4 => "100"
5 => "1000"
6 => "30"
7 => "55"
8 => "90"
9 => "80"
10 => "85"
11 => "110"
12 => "88"
13 => ""
]}
Illuminate\Support\Collection {#419 ▼
#items: array:14 [▼
0 => "0"
1 => "10"
2 => "20"
3 => "50"
4 => "100"
5 => "1000"
6 => "30"
7 => "55"
8 => "90"
9 => "80"
10 => "85"
11 => "110"
12 => "88"
13 => ""
]}
why isn't $perfiles2 not equal to [ 0,10, 20, 50, 100, and so on... ]