I've date in following format.
2019-02-27
I've to find sum of digits in above date. I've exploded the above value like this,
$date = '2019-02-27';
$dateArray = explode('-',$date);
Now date array will be like this:
array:3 [▼
0 => "2019"
1 => "01"
2 => "02"
]
With 2 loops, I can get sum of all digits but if there any much better way or builtin function to do this ?
Any kind of suggestion or help is appreciated.