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

Reply via email to