hi i am reciving this error: Warning: strtotime() expects parameter 1 to be string
When i try to do this:
$holidays = array("2008-12-25","2008-12-26","2009-01-01");
$today = date('Y-m-d');
$ticketDate = date('Y-m-d',strtotime($this->getCreateDate()));
$dayCount = $this->getWorkingDays($ticketDate,$today,$holidays);
$dayToHour = $dayCount * 24;
$horas=$cfg->getGracePeriod();
print_r ($holidays);
i get this: Array ( [0] => 2008-12-25 [1] => 2008-12-26 [2] => 2009-01-01 )
But when i replace
$holidays = array("2008-12-25","2008-12-26","2009-01-01");
with this:
$holidays = array($cfg->holydays());
i get this:
Warning: strtotime() expects parameter 1 to be string, array given in file.php on line 262
Array ( [0] => Array ( [0] => 2012-08-21 [1] => 2012-08-20 [2] => 2012-08-10 ) )
Can you help me plz?
You’re wrapping arrays in arrays. Looks like
$cfg->holydays()already returns an array, so a simplewould do the trick