I have an array containing an array key of a date, with the value being another array.
Array ( [2017-01-01] => Array ( [available] => 1 ) [2017-01-02] => Array ( [available] => ) [2017-01-03] => Array ( [available] => 1 ) )
I'm trying to find a way of seeing if an unavailable day is the last or first of a given set of unavailable days. I'm using the following code, but getting an error of "Only variables can be passed by reference".
foreach ( $calendar as $date ) {
if ( $date["available"] == 1 ) {
if ( next( $date["available"] != 1 ) ) {
echo $date . ' end';
}
}
}
I can see why this isn't working, but can't think of a way I can achieve what I want.