【发布时间】:2016-11-03 01:43:03
【问题描述】:
过滤这个多维数组以仅获取带有['virtual'] == true的数组的最聪明的方法是什么??
array (size=3)
0 =>
array (size=13)
'name' => string 'name' (length=4)
'label' => string 'Nombre' (length=6)
'sortable' => string 'true' (length=4)
'property_to_show' => boolean false
'image' => boolean false
'virtual' => boolean false <<<<<<<<<
'filter_parameter' => boolean false
'link' => boolean false
'entity' => boolean false
'boolean' => boolean false
'route_parameters' => string 'id' (length=2)
'text' => string '' (length=0)
'route' => string '' (length=0)
1 =>
array (size=14)
'virtual' => string 'true' (length=4) <<<<<<<<<<<
'label' => string 'Usuarios' (length=8)
'link' => boolean true
'class' => string 'DefaultBundle:User' (length=18)
'entity' => string 'User' (length=4)
'filter_parameter' => string 'company' (length=7)
'text' => string 'ver' (length=3)
'sortable' => boolean false
'name' => string '' (length=0)
'property_to_show' => boolean false
'image' => boolean false
'boolean' => boolean false
'route_parameters' => string 'id' (length=2)
'route' => string '' (length=0)
2 =>
array (size=14)
'virtual' => string 'true' (length=4) <<<<<<<<
'label' => string 'Productos exclusivos' (length=20)
'link' => boolean true
'class' => string 'DefaultBundle:Product' (length=21)
'entity' => string 'Product' (length=7)
'filter_parameter' => string 'company' (length=7)
'text' => string 'ver' (length=3)
'sortable' => boolean false
'name' => string '' (length=0)
'property_to_show' => boolean false
'image' => boolean false
'boolean' => boolean false
'route_parameters' => string 'id' (length=2)
'route' => string '' (length=0)
【问题讨论】:
-
应该如何对待
'virtual' => string 'false'?还有,'virtual' => string '0.00'... ?
标签: php