3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'tableData' => [ [ 'booking_name' => 'abc/xyz/123', 'pdg' => 'assure', 'user_area' => 'es st', 'release' => 'oss72', 'start_date' => '2017-06-20 00:00:00', 'end_date' => '2017-06-23 00:00:00', 'asset_info' => [ [ 'status' => 10, 'manufacturer' => 'HP', 'model' => 'HP BL460C GEN8', 'hardware_color' => ''#0066b3' ] ], 'full_name' => 'Valay Desai', 'email_address' => 'valay@xyz.com' ], [ 'booking_name' => 'abc/xyz/123', 'pdg' => 'assure', 'user_area' => 'ls reca', 'release' => 'oss72', 'start_date' => '2017-06-20 00:00:00', 'end_date' => '2017-06-23 00:00:00', 'asset_info' => [ [ 'status' => 10, 'manufacturer' => 'SUN', 'model' => 'SUN GEN8', 'hardware_color' => '#0066b3' ] ], 'full_name' => 'Chako Desai', 'email_address' => 'chako@xyz.com' ] ] ]; $filterBy = [ 'booking_name' => 'abc', 'pdg' => [ ['name' => 'Invalid', 'value' => 'Invalid'], ['name' => 'assure', 'value' => 'assure'] ], 'user_area' => [ ['name' => 'es st', 'value' => 'es st'], ['name' => 'Invalid', 'value' => 'Invalid'], ['name' => 'a&o', 'value' => 'a&o'] ] ]; // simplify structure $filterBy['pdg'] = array_column($filterBy['pdg'], 'value'); $filterBy['user_area'] = array_column($filterBy['user_area'], 'value'); var_export( [ 'tableData' => array_filter( $array['tableData'], function($row) use($filterBy) { return str_contains($row['booking_name'], $filterBy['booking_name']) && in_array($row['pdg'], $filterBy['pdg']) && in_array($row['user_area'], $filterBy['user_area']); } ) ] );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'tableData' => array ( 0 => array ( 'booking_name' => 'abc/xyz/123', 'pdg' => 'assure', 'user_area' => 'es st', 'release' => 'oss72', 'start_date' => '2017-06-20 00:00:00', 'end_date' => '2017-06-23 00:00:00', 'asset_info' => array ( 0 => array ( 'status' => 10, 'manufacturer' => 'HP', 'model' => 'HP BL460C GEN8', 'hardware_color' => '', ), ), 'full_name' => 'Valay Desai', 'email_address' => 'valay@xyz.com', ), ), )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.64 ms | 402 KiB | 8 Q