Advertisement
londomloto

Untitled

Feb 11th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.12 KB | None | 0 0
  1. $input = "1234";
  2. $hitung = array_reduce(str_split($input), function($c, $i){ $c += $i; return $c; });
  3.  
  4. echo $hitung;   // 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement