What function can be used to count the number of rows returned by a query in PHP?

To count the number of rows returned by a query in PHP, you can use the `mysqli_num_rows()` function. This function returns the number of rows in a result set. You can use it after executing a SELECT query to get the count of rows returned.

// Assuming $conn is the mysqli connection object and $query is the SELECT query
$result = mysqli_query($conn, $query);
$row_count = mysqli_num_rows($result);

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