Please read the guide .
Please answer the question in detail
<?php $num = 14597; $sum=0; $rem=0; for ($i =0; $i<=strlen($num);$i++) { $rem=$num%10; $sum = $sum + $rem; $num=$num/10; } echo "Sum of digits 14597 is $sum"; ?>
Doubtly is an online community for engineering students, offering:
Get the pro version for free by logging in!
5.7k questions
5.1k answers
108 comments
557 users