Level 67
$collection = collect([0 => 2, 1 => 3, 2 => 4]);
dump($collection->values()->toArray());
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Collection {#439 ▼
#items: array:3 [▼
0 => 2
1 => 3
2 => 4
]
}
Need to get something like this [2, 3, 4]
$collection = collect([0 => 2, 1 => 3, 2 => 4]);
dump($collection->values()->toArray());
Please or to participate in this conversation.