Re: Help retrieving an HTML array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mauricio Pellegrini wrote:

>  I have a HTML page with a form in which there are some inputs like
> these:
> 
> input type=text  name=xname value="3303"
> input type=text  name=xname value="9854"
> ....
> input type=text  name=xname value="n..."

That isn't an array, it is just a series of inputs with the same name. Most
query string / post data processing libraries will present it as an array
though (but in HTML its just data).

> How do I retrieve that array from within PHP ?

PHP is ... odd. Unlike every other query string / post data library I've
ever encountered, PHP will only present such data as an array if the name
ends in the characters "[]".

This has a minor advantage in that you can play with multidimensional arrays
(I've never found it useful myself), but demands that you alter your input
to suit its requirements.

The other option is to bypass PHP's query string / post data parser and
write your own (you can get access to the raw query string / post data).

-- 
David Dorward       <http://blog.dorward.me.uk/>   <http://dorward.me.uk/>
                     Home is where the ~/.bashrc is

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux