I'm trying to create an array inside an array, using a for loop - here's my code:
array(
'label' => 'Assign to user',
'desc' => 'Choose a user',
'id' => $prefix.'client',
'type' => 'radio'
'options' => array(
foreach ($clients as $user) {
$user->user_login => array (
'label' => $user->user_login,
'value' => $user->user_login,
),
}
)
)
Unfortunately this gives me a
"Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'"
For the line:
'options' => array(
I'm at a bit of a loss as to what has gone wrong - any help is much appreciated. $clients is defined elsewhere, so that is not the problem.