<?php
function process_something1($a){
foreach($a as $value){
//$something = 'Some math or other logic here';
echo $something = $value . "<br />";
}
return $something;
}
//$input=[]; // An array of some kind
$input=["Robert" => "Holland", "Hubba" => "Bubba"];
process_something1($input);
function process_something2($a){
foreach($a as $key => $value){
//$something = 'Some math or other logic here';
echo $something = $key . "---" . $value . "<br />";
}
return $something;
}
//$input=[]; // An array of some kind
$input=["Robert" => "Holland", "Hubba" => "Bubba"];
process_something2($input);
function process_something3($a){
foreach($a as $key => $value){
//$something = 'Some math or other logic here';
echo $something = $key . "---" . $value . "<br />";
}
return $something;
}
$cars = array(
"Honda" => "Odessey",
"Saturn" => "Vue",
"GMC" => "Yukon",
"Nissan" => "Xterra",
"Chevrolet" => "Suburban",
"Moneymaker" => 1,
);
process_something3($cars);
?>