Is there a better way of doing this?

    Date: 04/24/06 (PHP Community)    Keywords: no keywords

    if ($id=="11" || $id=="1" || $id=="2")
    {
    // do something
    }

    This is fine for one or two OR clauses, but when I have say 10 the code looks pretty ugly. Is there a better, cleaner way of coding this?

    Thanks!

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

« include with variables || creating variable »


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