Plural Standards

    Date: 09/13/06 (PHP Community)    Keywords: php

    What's the approriate way to do plurals in PHP with/without a template system?

    For example, you have the variable $num, and you want to echo out You have $num peaches. Or something. Right now I do:
    echo 'You have ' . $num . ' peach' . ($num!=1 ? 'es' : '') . '.';
    but I can imagine that's not the proper way to do things.

    Sure, it's not a problem for most of us, but I'm considering switching to a template program of sorts soon, and wonder if there is a standard we should be following

    Source: http://community.livejournal.com/php/494731.html

« open source Email class/system || Open for debate »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home