How can you determine the number of rows returned by a database query in PHP?

To determine the number of rows returned by a database query in PHP, you can use the `rowCount()` method provided by the PDO object. This method returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement executed. If you are using a SELECT statement, you can fetch all the rows and then use the `rowCount()` method to get the total number of rows returned.

// Assuming $pdo is your PDO object and $query is your database query

$stmt = $pdo->query($query);
$rows = $stmt->fetchAll();
$numRows = count($rows);

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