How can the mysql_num_rows function be utilized to find the number of rows returned by a query in PHP?

To find the number of rows returned by a query in PHP, you can use the mysql_num_rows function. This function returns the number of rows in a result set. You can use it after executing a SELECT query to determine the number of rows returned by the query.

$result = mysql_query("SELECT * FROM your_table");
$num_rows = mysql_num_rows($result);

echo "Number of rows returned: " . $num_rows;