Answers for "last index of array in php 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
0

php index of last element in array

<?php

$source_array = [
  'key1' => 'value1',
  'key2' => 'value2',
  'key3' => 'value3'
];

echo "Last index: " . array_key_last($source_array);

?>
Posted by: Guest on April-09-2021

Code answers related to "last index of array in php laravel"

Browse Popular Code Answers by Language