All pastes #759888 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-11-03 16:37 UTC
rendered paste body
<?php
//first and foremost, we declare and implement a function. The arguments' names are visible only inside the function and has nothing to do with the outside world
//Remember: a function is really like a black box
function add_numbers1($number) {
	echo 'number is: '. $number. '<br>';
}
function add_numbers2($parameter) {
	$r = 0; //return value
	for($i=0;$i < count($parameter);$i++) {
		$r = $r + $parameter[$i];
	}
	return $r;
}
$x = 13;
echo add_numbers1($x);
$y = array(1,2,3);
echo add_numbers2($y);
?>