I am trying to build a function that extracts information from a database and inserts it into an associative array in PHP using mysql_fetch_assoc
, and return the ar
If you just want information about what is in the array (for debugging purposes), you can use print_r($array)
or var_dump($array)
, or var_export($array)
to print it in PHP's array format.
If you want nicely formatted output, you might want to do something like:
$value) {
echo "".htmlspecialchars($name).
" ".htmlspecialchars($value)." ";
}
?>
This will, as you might already see, print a nicely formatted table with the names in the left column and the values in the right column.