View Single Post
Old 07-05-2010, 10:38 PM   #6 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

I think I might have done some cheating, but this is my take.
php Code:
<?php
$val = substr(pi()."", ((int) false), intval('4'));
$val = str_split(implode("", explode(".", $val)));
$val = array_reduce($val, function ($x, $y) { return intval($x) + intval($y); });
echo $val;
?>
this is using php 5.3 of course
tony is offline  
Reply With Quote