Re: Re: $_POST variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You could use foreach to iterate through the post variables until you
encounter a match:

foreach ($_POST as $key =>  $value){
     if (substr($key, 0, 6) == "radio_") {
        $buttonName = $key;
        $buttonValue = 4value;
        break 2;
     }
}

I haven't tried the above code, but I hope someone will correct my
efforts if I'm wrong.

given your code example -> 'break 2;' -- s/b just 'break;' ... 'break 2;' is to exit the outer loop of a nested loop which is not the case here.

Rich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux