Skip to content

Instantly share code, notes, and snippets.

@fakeheal
Last active August 29, 2015 14:08
Show Gist options
  • Save fakeheal/214e3cfb32e6fdc4aae8 to your computer and use it in GitHub Desktop.
Save fakeheal/214e3cfb32e6fdc4aae8 to your computer and use it in GitHub Desktop.
PHP: Large sum - ProjectEuler Problem #13
<?php
$new = explode("\n", $number);
$sum = 0;
foreach($new as $n){
$sum += trim($n);
}
echo $sum;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment