2020-12-27, 02:08 PM
Hi
let's say i have array
how to get from this array only this part where array key (predefined) > then 3
maybe there is simple/beter way then foreach?
let's say i have array
how to get from this array only this part where array key (predefined) > then 3
$u['1'] = array(
"id" => "1",
"uid" => "1",
);
$u['2'] = array(
"id" => "2",
"uid" => "2",
);
$u['4'] = array(
"id" => "4",
"uid" => "4",
);
echo "<pre>";
print_r($u);
echo "</pre>";
maybe there is simple/beter way then foreach?
foreach($u as $key => $vol)
{
if($key < 3)
{
unset($u[$key]);
}
}