I have two arrays and I want to link together when processing them.
$dat = array(
"2020-02-01",
"2020-02-05",
"2020-02-10",
"2020-02-12",
"2020-02-15"
);
$word = array(
"Attend To,Explore,Unaided,dull,bad"
);
//User input
$start = "2020-01-01";
$end = "2020-02-07";
I want the input to affect the second array too, so when the first array gets its result from first 2, then the second array too should have it from the first 2.
//Filter out dates between start and end date
$result = array_filter($dat, function($data_item) use($start, $end) {
return $data_item >= $start && $data_item <= $end;
});
and the result is
Array
(
[0] => 2020-02-01
[1] => 2020-02-05
)
I want it to be able to link $dat
and $word
so that the result for word too will be
Array
(
[0] => Attend To
[1] => Explore
)