Re: Bug in PHP?
| From: | Richard Lynch | Date: | Thu, 18 Jul 2002 23:55:28 +0000 |
| Subject: | Re: Bug in PHP? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108386@lists.php.net to get a copy of this message | ||
>Hello,
>
>I'm trying to explode an associative array element in $HTTP_POST_VARS
>retrieved from submitting am html form. The URL to the form is:
>http://www.funfry.com/form.html
>
>Now when I try to explode $HTTP_POST_VARS["domains"] it doesn't seem to have
>the desired effect. I use the syntax "$site = explode("
>",$HTTP_POST_VARS["domains"]);" and instead of the expected result of:
>
>$site[0] = "www.php.net";
>$site[1] = "www.jokaroo.com";
>$site[2] = "www.gnu.org";
>
>I get: $site[0] = "www.php.net www.jokaroo.com www.gnu.org";
>
>The value of $HTTP_POST_VARS["domains"] after submitting the form is
>"www.php.net www.jokaroo.com www.gnu.org". Does anyone have an idea of how
>I can get each domain in a seperate array index?
var_dump($HTTP_POST_VARS['domains']);
I *suspect* that you actually have:
<INPUT NAME=domains[] VALUE=www.php.net>
<INPUT NAME=domains[] VALUE=www.jokaroo.com>
<INPUT NAME=domains[] VALUE=www.gnu.org>
If so, then $HTTP_POST_VARS['domains'] is an *ARRAY* already, and doing an
explode on it is just silly.
--
Like Music? http://l-i-e.com/artists.htm