I'm doing a calendar with possibly more than 1 event matching the date each day. Currently I'm puzzled as how to discover more than the first match with array_search. Here is what I'm doing right now.
if (array_search($date_today, $event_start) !== FALSE ) {
$date_match = array_search($date_today, $event_start);
$name = $event_name[$date_match];
}
Can I advance the array_search with a 'while' or 'for each' statement to find multiple matches? In case it's important my date variables are dates like 1368680400.
Documentation for array_search tells us:
If needle is found in haystack more than once, the first matching key is returned. To return the keys for all matching values, use array_keys() with the optional search_value parameter instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With