Mix an array on Laravel Collection

  arrays, iteration, laravel, laravel-collection, php

I have an array looks like this code bellow:

$arr = ["a", "b", "c", 1, 2, 3, 4, 5, 6];

And I use Laravel Collection for this array, so the code looks like this:

$collect = collect($arr);

What I want is return new collection with array value looks like this:

$return_arr = ["a", 1, "b", 2, "c", 3, 4, 5, 6];

Can you guys give me help

Thanks in advance

Source: Laravel

Leave a Reply