Page 1 of 1
array_walk(), array_search()
Posted: Tue Mar 04, 2003 6:46 pm
by dstefani
The goal:
To match the array VALUES returned from an HTML form of checkboxes,
against the KEYS of another array (array2),
and when I get a match I get the value of the other array(array2) as my output.
Any suggestions?
Thanks,
Don
Posted: Tue Mar 04, 2003 6:55 pm
by dstefani
I hate when I do that -
Ask for help and then go and figure it out.
Here's what I did, this didn't work before, I must have had typo?
Code: Select all
foreach ($arr_custView as $key => $value)
{
foreach ($form_array as $key2 => $value2)
{
if($key == $value2)
{
echo "$value<br>\n";
}
}
}
The larger array is on the outside.
The form array is on the inside.
The echo is just for testing.
12 hours is a long enough day for today.
If you know of a more 'elegant' way to do this, by all means share brother and sisters!
- D
Posted: Tue Mar 04, 2003 9:05 pm
by hob_goblin
maybe...
Code: Select all
foreach ($arr_custView as $key => $value)
{
if(in_array($key, $form_array)){
echo $form_arrayї$value]."<br>\n";
}
}
Posted: Wed Mar 05, 2003 12:32 am
by dstefani
Thanks, but nope, that didn't work.
At this late hour i don't know why.
Thanks,
- D
Posted: Wed Mar 05, 2003 12:36 am
by hob_goblin
oh try this...
Code: Select all
foreach ($arr_custView as $key => $value)
{
if(in_array($key, $form_array)){
echo $value."<br>\n";
}
}
Posted: Wed Mar 05, 2003 11:09 am
by dstefani
OK, I'll grant you that one Jedi, but can you answer the mystery of the
"form in the popup window sending it's data to the opener and then closing, that works in both IE and NS"?
Thanks
(OT, I know, but hey... )