NYCPHP Meetup

NYPHP.org

[nycphp-talk] Creating multidimensional arrays

Emmanuel. M. Decarie emm at scriptdigital.com
Wed May 14 12:17:13 EDT 2003


>I'm not sure how compliant this is to HTML specifications, but one
>useful thing you can do is use arrays in form variables, for instance:
>
><input type="text" name="array[test]" value="">
>
>When you post this, $_POST['array'] will be a populated array.
>I have found this useful when you have some sort of multiple select.
>You can have 15 check boxes with the name="option[<some unique id
>here>]" and then you just get an array of all of the select options to
>loop through.
>
>I'm not sure if this would speed anything up (it may make it even make
>it a bit slower) but it does provide a small amount of convenience.
>
>-Max

Hey, that's a nice tip. Thanks
-Emmanuel
-- 
______________________________________________________________________
Emmanuel Décarie / Programmation pour le Web - Programming for the Web
Radio UserLand/Frontier - Perl - PHP - Javascript  <http://scriptdigital.com/>
Blog: <http://blog.scriptdigital.com> - AIM: scriptdigital




More information about the talk mailing list