Thanks Installer. Not only did that fix it but I now have (2) solutions that I would like to pass along for anyone else having that problem.
You can either pass the variable into the function when you call the function:
function printFamily($familyName, $famArray) {
$col=0;
if (! empty($famArray[$familyName])) {
echo $familyName."s<hr />";
while (isset($famArray[$familyName][$col])) {
echo $famArray[$familyName][$col]." $familyName<br>";
$col++;
};
} else {
echo "$familyName does not exist. Please try again.";
};
echo '<hr />';
}
printFamily(Gibson, $family);
or you can set the variable in question as a global within the function:
function printFamily($familyName) {
global $family;
$col=0;
if (! empty($family[$familyName])) {
echo $familyName."s<hr />";
while (isset($family[$familyName][$col])) {
echo $family[$familyName][$col]." $familyName<br>";
$col++;
};
} else {
echo "$familyName does not exist. Please try again.";
};
echo '<hr />';
}
Good luck!
-Carl
--------------------rkitecsure[at]gmail.com