3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array( 0 => array ( 'Id' => '1', 'Departments' => 'Account Management', 'Parent Id' => 0 ), 1 => array ( 'Id' => 2, 'Departments' => 'Ad Operations', 'Parent Id' => 0 ), 2 => array ( 'Id' => 3, 'Departments' => 'Corporate', 'Parent Id' => 0 ), 3 => array ( 'Id' => 4, 'Departments' => 'Creative Solutions', 'Parent Id' => 0 ), 4 => array ( 'Id' => 5, 'Departments' => 'Data & Research', 'Parent Id' => 0 ), 5 => array ( 'Id' => 6, 'Departments' => 'ENS - Account Management', 'Parent Id' => 0 ), 6 => array ( 'Id' => 7, 'Departments' => 'ENS - Creative Solutions', 'Parent Id' => 0 ), 7 => array ( 'Id' => 8, 'Departments' => 'ENS - Development', 'Parent Id' => 0 ), 8 => array ( 'Id' => 9, 'Departments' => 'ENS - Engineering', 'Parent Id' => 0 ), 9 => array ( 'Id' => 10, 'Departments' => 'ENS - Management', 'Parent Id' => 0 ), 10 => array ( 'Id' => 11, 'Departments' => 'ENS - Product Management', 'Parent Id' => 0 ), 11 => array ( 'Id' => 12, 'Departments' => 'Exchange', 'Parent Id' => 0 ), 12 => array ( 'Id' => 13, 'Departments' => 'Finance', 'Parent Id' => 0 ), 13 => array ( 'Id' => 14, 'Departments' => 'Human Resources', 'Parent Id' => 0 ), 14 => array ( 'Id' => 15, 'Departments' => 'Inventory', 'Parent Id' => 0 ), 15 => array ( 'Id' => 16, 'Departments' => 'Management', 'Parent Id' => 0 ), 16 => array ( 'Id' => 17, 'Departments' => 'Marketing', 'Parent Id' => 0 ), 17 => array ( 'Id' => 18, 'Departments' => 'Operations', 'Parent Id' => 0 ), 18 => array ( 'Id' => 19, 'Departments' => 'Product Strategy', 'Parent Id' => 0 ), 19 => array ( 'Id' => 20, 'Departments' => 'R&D', 'Parent Id' => 0 ), 20 => array ( 'Id' => 21, 'Departments' => 'Sales ', 'Parent Id' => 0 ), 21 => array ( 'Id' => 22, 'Departments' => 'Tech Sol - Client Services', 'Parent Id' => 0 ), 22 => array ( 'Id' => 23, 'Departments' => 'Tech Sol - Management', 'Parent Id' => 0 ), 23 => array ( 'Id' => 24, 'Departments' => 'Technology Sales', 'Parent Id' => 0 ), 24 => array ( 'Id' => 25, 'Departments' => 'UK - Account Management', 'Parent Id' => 0 ), 25 => array ( 'Id' => 26, 'Departments' => 'UK - Ad Ops', 'Parent Id' => 0 ), 26 => array ( 'Id' => 27, 'Departments' => 'UK - Creative', 'Parent Id' => 0 ), 27 => array ( 'Id' => 28, 'Departments' => 'UK - Finance', 'Parent Id' => 0 ), 28 => array ( 'Id' => 29, 'Departments' => 'UK - Inventory', 'Parent Id' => 0 ), 29 => array ( 'Id' => 30, 'Departments' => 'UK - Management', 'Parent Id' => 0 ), 30 => array ( 'Id' => 31, 'Departments' => 'UK - Sales', 'Parent Id' => 0 ), 31 => array ( 'Id' => 32, 'Departments' => 'UK - Sales Management', 'Parent Id' => 0 ), 32 => array ( 'Id' => 33, 'Departments' => 'R&D - Data Sciences', 'Parent Id' => 20 ), 33 => array ( 'Id' => 34, 'Departments' => 'R&D - Data/Tech Ops', 'Parent Id' => 20 ), 34 => array ( 'Id' => 35, 'Departments' => 'R&D - Development', 'Parent Id' => 20 ), 35 => array ( 'Id' => 36, 'Departments' => 'R&D - Engineering', 'Parent Id' => 20 ), 36 => array ( 'Id' => 37, 'Departments' => 'R&D - Management', 'Parent Id' => 20 ), 37 => array ( 'Id' => 38, 'Departments' => 'R&D - Product Management', 'Parent Id' => 20 ), 38 => array ( 'Id' => 39, 'Departments' => 'R&D - Data Sciences', 'Parent Id' => 20 ), 39 => array ( 'Id' => 40, 'Departments' => 'Sales  - Advertising Solutions Group', 'Parent Id' => 21 ), 40 => array ( 'Id' => 41, 'Departments' => 'Sales - Creative Solutions', 'Parent Id' => 21 ), 41 => array ( 'Id' => 42, 'Departments' => 'Sales - Emerging Media', 'Parent Id' => 21 ), 42 => array ( 'Id' => 43, 'Departments' => 'Sales - Exchange', 'Parent Id' => 21 ), 43 => array ( 'Id' => 44, 'Departments' => 'Sales - Management', 'Parent Id' => 21 ), 44 => array ( 'Id' => 45, 'Departments' => 'Sales - Media', 'Parent Id' => 21 ), 45 => array ( 'Id' => 46, 'Departments' => 'Legal', 'Parent Id' => 0 ) ); /*var_dump(array_filter($a, function($department){ $r = ($department['Departments'] == 'Sales - Creative Solutions'); var_dump($r); return $r; })); $b = []; $b['Sales  - Advertising Solutions Group'] = 1; var_dump($b);*/ var_dump(array_search('Sales - Media', $a));
Output for 4.3.0 - 7.1.0
bool(false)