What are some common pitfalls when handling singular and plural words in PHP code?

One common pitfall when handling singular and plural words in PHP code is not accounting for both cases when outputting text dynamically. To solve this, you can use PHP's `pluralize` function to correctly handle singular and plural forms of words based on a count.

function pluralize($count, $singular, $plural) {
    return $count == 1 ? $singular : $plural;
}

$count = 5;
echo "I have $count " . pluralize($count, 'apple', 'apples');