On 3/11/2011 2:43 PM, Geoff Lane wrote:
[snip]
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.
ok, now I am very new to php, so if i got this wrong be nice.
It APPEARS TO ME that you are setting a variable called buttonName
to the extracted value stored in $key for each name in the post
submission, and a variable named buttonValue for the item's value.
THEM, you do the same thing again to the same destination variables
for the next name/value pair, and so-on until they list of
name/value pairs is exhausted. IF this understanding is correct,
only the LAST name/value pair will emerge from the process intact;
prior values will be obliterated. Would they not be better to append
them to a single dimensioned array, which starts life as a null
array? If I am getting this wrong, please administer wet mackerel
therapy to my tired head and explain the facts.
--
end
Very Truly yours,
- Kirk Bailey,
Largo Florida
kniht
+-----+
| BOX |
+-----+
think
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php