Verilen orijinal kodlar:
foreach($option as $name=>$value)
$array[$name] = $value;
ve $ gibi isim
button[0][text], button[0][value], button[1][text], spider[0][name], ...
Sonuç dizisi olacak
array('button[0][text]' => 'its text',
'button[0][value]' => 'its value',
'button[1][text]' => 'its text',
'spider[0][name]' => 'its name',
)
Ancak, ne ben istiyorum
array('button' => array( array('text'=>'its text', 'value'=>'its value'), // this is $array[button][0]
array('text'=>'its text') // this is $array[button][1]
),
'spider' => array( array('name'=>'its name') // this is $array[spider][0]
)
)
How could i do this? ...