Easiest way is this

foreach ($_POST['test'] as $key => $value)
{
    echo $key . '|' . $value . "\n";
}

By putting the [] on the end of the variable name in the html, it has turned
the variable test into an array.  Because test is a post variable, it is now
multidimensional.


"Tyler Longren" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,

http://www.php.net/manual/en/faq.html.php#faq.html.select-multiple

I read that.  Doesn't work in php since the whole register_globals
thing.  Now, when I get the results from a form, they're all in a
$_POST[] array.  Example.

When I have a <select name="test" MULTIPLE>
I would have to access the values of the "test" field like this:
count($_POST['test']);

But since I have to have the [] in the name="<select name="test[]"
MULTIPLE>" ()part, I get parse errors when trying to read it:
ex: count($_POST['test[]']);

That doesn't even look right.  Anyone understand what I'm tryin to get
at?  Any help would be great.

Best Regards,
--
Tyler Longren
J.D. Web Services, L.C.

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

Reply via email to