Skip to content

Instantly share code, notes, and snippets.

@lexnjugz
lexnjugz / upload.php
Created April 30, 2019 12:56 — forked from fowkswe/upload.php
Replacement for sendy's upload.php that sends files to S3 rather than the server.
<?php
//
// this replaces includes/create/upload.php - besure to save your old upload.php!
// you must put the S3.php file in includes/helpers/S3.php
// you can get it here:
// https://github.com/tpyo/amazon-s3-php-class
//
// This is an improvement on this gist:
// https://gist.github.com/Wysie/03934b6a79a715772abd
//
function super_sum($A){
$sum = 0;
foreach ($A as $key => $value){
//$sum += $value;
do {
$sum += $value % 10;
} while ($value = (int) $value / 10);
}
return $sum;
}