POSTing complete arrays
Posted: Fri Apr 01, 2005 7:49 am
I tried writing a function for putting a complete array into hidden fields, but failed:
I thought if this would be submitted and extracted, the complete array would be regenerated, but it is not created.
I also do not know how foreach behaves on arrays that are more than 2-dimensional...!?
How can I drag arrays confortably to the next site? (the contents of the array is dynamic, i.e. both values and keys might change)
Greetings,
feyd | Please review how to post code using
Code: Select all
function insertarray ($array, $arrayname)
{
$include="e;"e;;
foreach ($array as $key => $value) {
$include = $include."e;<input type=hidden name ='$"e;."e;$arrayname"e;."e;ї$key]' value='$value'><br />\n"e;;
}
return $include;Code: Select all
echo insertarray($arrayname, "e;arrayname"e;);I also do not know how foreach behaves on arrays that are more than 2-dimensional...!?
How can I drag arrays confortably to the next site? (the contents of the array is dynamic, i.e. both values and keys might change)
Greetings,
feyd | Please review how to post code using
Code: Select all
andCode: Select all
tags. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]