Foreach loop inside array

后端 未结 3 1557
灰色年华
灰色年华 2020-11-27 06:02

I\'m trying to create an array inside an array, using a for loop - here\'s my code:

    array(
    \'label\' => \'Assign to user\',
    \'desc\' => \'C         


        
3条回答
  •  没有蜡笔的小新
    2020-11-27 06:11

    You use foreach to access the data, not define it.

    Try this:

    array(
        'label' => 'Assign to user',
        'desc' => 'Choose a user',
        'id' => $prefix.'client',
        'type' => 'radio'
        'options' => $clients
        )
    

    If you need to change the structure of the data for 'options', do this before defining the primary array.

提交回复
热议问题