pc-buddy
asked on
Php Array Diff
Hi,
I have 2 arrays
All I get back is word "Array"
Any ideas thanks
I have 2 arrays
$dates
Array
(
[0] => 2016-11-01
[1] => 2016-11-08
[2] => 2016-11-15
[3] => 2016-11-22
[4] => 2016-11-29
)
$holidays
Array
(
[0] => 2016-11-07
[1] => 2016-11-08
[2] => 2016-11-09
[3] => 2016-11-10
[4] => 2016-11-11
)
$totals = array_diff($dates, $termtimedates) . '<br><br>';
echo $totals . '<br><br>';
All I get back is word "Array"
Any ideas thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This happens any time PHP does type-coercion from Array to String (not just in echo). It's a terrible design flaw, but it's too late to fix it now that it's been baked into the language. A more appropriate approach would be to trigger a warning!
ASKER