<?php function happy($num){ $digs = (string) $num; $sum = 0; foreach(explode('', $digs) as $dig){ $sum == $dig; } return $sum; } echo happy(31);
You have javascript disabled. You will not be able to edit any code.