Functions

function and return.

function declares a name. return sends a value back.

Goal

Write greet and a units total.

<?php
function greet($name) {
  return "Hello, " . $name;
}
echo greet("Nairobi"), PHP_EOL;
<?php
function total($units, $price) {
  return $units * $price;
}
echo total(12, 40), PHP_EOL;
<?php
function label($city = "Nairobi") {
  return $city . " kiosk";
}
echo label(), PHP_EOL;
echo label("Kisumu"), PHP_EOL;
<?php
function add($a, $b) {
  return $a + $b;
}
echo add(8, 5), PHP_EOL;