note 27281 deleted from function.is-array by sniper
| From: | sniper@php.net | Date: | Sat, 23 Aug 2003 00:30:03 +0000 |
| Subject: | note 27281 deleted from function.is-array by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54931@lists.php.net to get a copy of this message | ||
Note Submitter: vh1@punkhardcore.net
----
just in case you have:
<input type=text name="cookie[name]">
<input type=text name="cookie[life]">
<input type=text name="admin[username]">
<input type=text name="admin[password]">
try this:
while(list($key,$val) = each($_POST)){
$parent = $key;
if(is_array($val)){
while(list($key,$vall) = each($val)){
$config .= "$".$parent."[$key] =\t\t\"$vall\"\n";
}
}
}
print nl2br($config);
this will display all your values as '$parent[$key] = "$value\n"'
for easy creation of a file or something like that, hopes it helps