Zitat:
Zitat von AmicaNoctis
Da hat aber jemand nen ziemlichen Blackout. array_merge ist nicht manipulativ sondern gibt ein neues Array zurück. Warum es in diesem Fall umständlich ist, entnimmst du bitte meinem Edit vom letzten Beitrag.
|
ja stimmt .. nun hab ichs aber
passiert halt auch mal ...
PHP-Code:
$post_array = array();
$data = array();
foreach($_POST as $post => $key)
{
if(!is_array($key))
{
$post_array[$post] = $key;
}
elseif(is_array($key))
{
$data[$post] = $key;
}
}
$result = array();
foreach ($data as $field => $idvalues) {
foreach ($idvalues as $id => $values) {
foreach ($values as $index => $value) {
// \x01 ist nur ein Trennzeichen, das mit sehr hoher Wahrscheinlichkeit
// nicht selbst in $id oder $index vorkommt
$result[$id . "\x01" . $index]["id"] = $id;
$result[$id . "\x01" . $index]["index"] = $index;
$result[$id . "\x01" . $index][$field] = $value;
}
}
}
$result = array_values($result);
mein Code