我想基于多维数组中的数字动态创建一个数组
这是代码
$meta_box = array(
'id' => 'my-meta-box',
'title' => 'Custom Input Fields',
'page' => 'page',
'context' => 'normal',
'priority' => 'high',
'fields' => array (
array( //this array must be created dynamic
'name' => 'Textarea',
'desc' => 'Enter big text here',
'id' => 'textarea', //id is textarea + number
'type' => 'textarea',
'std' => 'Default value'
)
)
);
Run Code Online (Sandbox Code Playgroud)
我希望最后一个数组是由一个数字动态创建的,所以如果数字是2,那里必须有2个数组,名称相同,desc,type,str但是不同的ID.
这有可能是某种方式吗?