Answers for "check last index of array laravel"

PHP
1

array_last in laravel 8

use Illuminate\Support\Arr;

$array = [100, 200, 300, 110];

$last = Arr::last($array, function ($value, $key) {
    return $value >= 150;
});

// 300
Posted by: Guest on September-21-2021

Code answers related to "check last index of array laravel"

Browse Popular Code Answers by Language