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.


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to