Return to Snippet

Revision: 42144
at February 28, 2011 08:27 by iamdezzy


Initial Code
<?php 
	function sum($from, $to){
		if ($from == $to) {
			return $from;
		}
	return $to + sum($from,$to-1);
}

echo sum(8,100);
?>

Initial URL


Initial Description
Easy but powerful.

Initial Title
Function for Summation

Initial Tags
math

Initial Language
PHP