difference between mysql_fetch_object and mysql_fetch_array in PHP

mysql_fetch_object :
mysql_fetch_object returns the results from database as objects.(fetches a result row as object)
$result->email



Example:
<?php
mysql_connect("host", "username", "pwd");
mysql_select_db("db");
$result = mysql_query("select * from employees");
while ($rows = mysql_fetch_object($result))
{
    echo $empname=$row->name;
    echo "<br>";
   echo $empmail=$row->email;
}
?>
Output
Rajesh
test@example.com

mysql_fetch_array:
Fetch a result row as an associative array, a numeric array, or both
$row[0],$row["name"];

Example:
<?php
mysql_connect("host", "username", "pwd");
mysql_select_db("db");
$result = mysql_query("select * from employees");
while ($rows = mysql_fetch_array($result))
{
    echo $empname=$row[0];
echo "<br>";
   echo $empmail=$row["email"];
}


?>
Output
Rajesh
test@example.com