I have a function that passes an argument with two default values…
function places($location="Minneapolis", $lodging="Mom's house")
{
echo "enjoys going to {$location} and staying at {$lodging} while on vacation.";
}
places("St. Paul","Grandma's house");
I need to pass the function 10 times using 10 different names of people defined as a variable passed as an argument. What would the syntax be assuming the output would resemble this:
Joe enjoys going to St. Paul and staying at Grandma’s house while on vacation.
See my comments in the code. You didn’t make the
$iiterator a valid PHP variable, so FYI: All PHP variables must be prefixed with a$.http://codepad.org/QHh83cKz
OUTPUTS