Multidimensional GETs and POSTs
| From: | Steven Lawrance | Date: | Mon, 09 Aug 1999 01:24:24 +0000 |
| Subject: | Multidimensional GETs and POSTs | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-9667@lists.php.net to get a copy of this message | ||
After much toil and even a few failed attempts to compile PHP4 on the SGI
IRIX system (when linking in Apache as a static Apache module, it said that
alloca was not found when linking a Zend library), I came up with a hack
that enables multi-dimensional arrays in PHP3. Apparently, only
single-dimensional arrays are allowed, but the "][" between each dimension
is included within the associative index. The following code seems to fix
it up nicely :-)
while (list($key, $val) = each($HTTP_POST_VARS)) {
if (is_array($val)) {
while (list($key2, $val2) = each($val)) {
eval("\$".$key."[$key2]=\"$val2\";");
}
}
}
I tried looking for the code that automatically makes these variables global
but couldn't find it :-(. Would it be possible to add multi-dimensional
POSTs and GETs? If not, at least there's a PHP workaround ;-)
Thanks :)
--Steven Lawrance--
Personal Web Site and E-Mail:
slawrance@technologist.com
http://www.bryant.edu/~ssl2 (SSL2)