<?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);
?>