How can you extract individual categories from a result set in PHP?

To extract individual categories from a result set in PHP, you can loop through the result set and access the category value for each row. This can be done using a foreach loop or a while loop to iterate over the result set and extract the category value from each row.

// Assuming $result is the result set obtained from a database query
foreach ($result as $row) {
    $category = $row['category'];
    // Do something with the category value, such as printing it or storing it in an array
    echo $category . "<br>";
}