I'm using strtotime() in PHP to get the days of a week (I made a calendar, with different views, so it changes). PHP Unit gives me the warning of Array to string conversion whenever I try this:
$monday = date('Y-m-d', strtotime($sunday . '+ 1 day'));
$sunday is a variable that I get this way:
public function GetWeekRange($date) {
$ts = strtotime($date);
$start = (date('w', $ts) == 0) ? $ts : strtotime('last sunday', $ts);
return date('Y-m-d', $start);
}
and $date is a string in the format 'YYYY-mm-dd'
I'm not sure why I get this error, the code works just fine, but the test gives that warning, and it's going to give a warning on my environment where all the different projects are shown (red/green depending on whether there's a failure or not).
Thanks,
Fer