2 ms·
// Results in 10 $total = 'I ate 3 bananas yesterday' + 'and I ate 7 bananas today'; "[this example] contains numeric values, so everything else is strippe
by infogulch 10y ago
// Results in 10
$total = 'I ate 3 bananas yesterday' + 'and I ate 7 bananas today';
"[this example] contains numeric values, so everything else is stripped out, and the sum of those are used to calculate the total of 10. But it would still be nice to see a warning, as this may not be intended behaviour."
this may not be intended behaviour
may
- pan69 10y agoWhy not? In PHP you concatenate strings with a "." $total = 'I ate 3 bananas yesterday' . 'and I ate 7 bananas today';