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