Title explains it all, I know how to do this the long way but I have always wondered if there was a shorter way to do so.
Lets say,
$mutli = array(
array('name' => 'john', 'adult' => 'true' ),
array('name' => 'eric', 'adult' => 'true' ),
array('name' => 'ryan', 'adult' => 'false' )
);
Is there a better way to select all lower arrays where adult == true?
$list = array();
foreach( $multi as $sub ){
foreach( $sub as $key => $value ){
if( $key == "adult" && $value == "true" )
array_push( $list, $sub );
}
}
Not urgent, but I was always curious.
perhaps,
while( $key => $value as each($mutli) )
or something :p