Home >Backend Development >PHP Tutorial >PHP two-dimensional array to get data based on conditions_PHP tutorial
There is an array $point_arr (as shown below), take out the array row with user_id = 3.
The code is as follows:
//Your array
$point_arr = array(
"point"=>2),
array("id"=>2,"id"=>3,"point"=>2),
array("id"=> 3,"id"=>3,"point"=>2),
array("id"=>4,"id"=>3,"point"=>2),
); 🎜> //$new is a new array used to receive user_id=3.
$ New [] = $ point_arr [$ i];
}
}
// Output new array.
for($i = 0;$i
}
?>
http://www.bkjia.com/PHPjc/478845.html
www.bkjia.com