Re: [PHP3] Multi-dimension arrays.
| From: | (Richard Lynch) | Date: | Fri, 09 Jun 2000 23:19:43 +0000 |
| Subject: | Re: [PHP3] Multi-dimension arrays. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1496@lists.php.net to get a copy of this message | ||
In article <003401bfd065$b9779740$0effa4c0@wrs002>,
greg@william-russell.co.uk ("Greg Linnell") wrote:
> This a HTML question really but:-
>
> Has anyone had experience with user definable grids using
>
> <INPUT TYPE=text NAME={some way of defining a multi-dimension
array that
> can be passed to php3 (so data can be easily dumped to a db or whatever) }>
There's no easy way to do this completely automatically, but something
like this might be fairly extensible:
<INPUT TYPE=text NAME=whatever[3][5] VALUE=42>
<?php
if (isset($whatever)){
while (list($key, $value) = each($whatever)){
$indices = explode('][', $key);
$real[$indices[0][$indices[1]] = $value;
}
}
?>
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)