}


my problem is that, as long as the $_POST['strap_city'] array exists, "lee county" ends up checked. i'm pretty sure it's because $code for "lee county" is zero. i've tried writing this conditional every way i can think of, but the damned thing keeps ending up selected. any suggestion on how i can get "lee county" checked only when a 0 is actually in the array?

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

    false positive with in_array and 0

    Date: 03/08/07 (PHP Community)    Keywords: no keywords

    i have a form with an array of checkboxes. after a query is submitted, the page refreshes with the form filled in per the users' choices. the array of checkboxes is created with the following relevant snippets:


    $cities = array('B' => 'bonita springs',
                    'C' => 'cape coral',
            'P' => 'fort myers',
            'W' => 'fort myers bch',
            'T' => 'sanibel',
            '0' => 'lee county'
                );


    [...]

    foreach ($cities as $code=>$city) {
                 ?>
                 

                                        />
                         
             
« Pagination || Function Help needed. »


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