I have array
such as below
Array ( [0] => 2 [1] => 4 [2] => 5)
In which 2,4,5
is value and i need only list of value like [2,4,5]
is it possible in laravel??
I have array
such as below
Array ( [0] => 2 [1] => 4 [2] => 5)
In which 2,4,5
is value and i need only list of value like [2,4,5]
is it possible in laravel??
$list=[];
$arr=array( 0=> 2,1 => 4,2 => 5);// This is the original array
foreach($arr as $k=>$v ){
array_push($list,$v);
}
// Now,$list is what you need! [2,4,5]
I don't think this question is about laravel, this is basic knowledge of PHP array!