';
}
else {
// the array has entries, so start an
// HTML table to display them.
echo '
';
echo '';
echo 'Key | ';
echo 'DataType | ';
echo 'Value | ';
echo '
';
// use a do loop to iterate over the
// entries in the array.
do {
echo '';
echo key($var);
echo ' | ';
echo gettype(key($var));
echo ' | ';
// perform the magic of recursion using the
// VALUE of the current key/value pair.
array_dump($var[key($var)]);
echo " |
";
} while (next($var));
// end the HTML table after all of the
// array entries have been displayed.
echo "
";
}
break;
// switch statements should always have a default
// clause - just in case the data has a value
// your program doesn't expect.
default:
echo "unknown data type";
break;
}
}
?>