Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$ggg = [
'lol1' => 10,
'lol2' => 20,
'fhdjk' => 5,
'lol3' => 30,
];
$min_el = array_shift(array_values($ggg));
$min_key = array_shift(array_keys($ggg));
foreach($ggg as $key=>$el){
if($el < $min_el){
$min_el = $el;
$min_key = $key;
}
}
print_r([$min_key, $min_el]);