I want to extract data from the following array where key 3 = 2017-10-27:
Array
(
[0] => Array
(
[0] => 65604
[1] => 1
[2] => 0
[3] => 2017-09-04 18:22:34
)
[1] => Array
(
[0] => 69
[1] => 29
[2] => 0
[3] => 2017-10-27 07:27:59
)
[2] => Array
(
[0] => 70
[1] => 1
[2] => 0
[3] => 2017-09-10-27:44:13
)
[3] => Array
(
[0] => 71
[1] => 5
[2] => 0
[3] => 2017-09-05 07:52:54
)
[4] => Array
(
[0] => 72
[1] => 28
[2] => 0
[3] => 2017-09-05 07:54:38
)
[5] => Array
(
[0] => 73
[1] => 18
[2] => 0
[3] => 2017-09-05 07:54:53
)
AS the array is too big, and contains around 20000 data. I want to pull out just the data I need. I used foreach loop but it took me too much time as I also want to update in the database
foreach($array as $k=>$val){
$all = new DateTime($val[3]);
$hun = $all->format('H:i:s');
$date= $all->format('Y-m-d');
$id= $val[1];
if($date=='2017-10-27'){
//$dbh->query("UPDATE table SET date='$date' WHERE id='$id' AND date IS NULL");
}
}
Database not update, the print_r() took around 5 minutes. Any better way to filter out just the data I need.