3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data['menus'] = array( '1' => array( 'Dashboard' => '/LMS/Dashboard', ), '2' => array( 'Notifications' => '/LMS/Notifications', ), '3' => array( 'Clients' => '/LMS/Clients', ), '4' => array( 'Penalties' => '/LMS/Penalties', ), '5' => array( 'Payments' => '/LMS/Payments', ), '6' => array( 'Profit' => '/LMS/Profit', ), '7' => array( 'Income' => '/LMS/Income', ), '8' => array( 'Outcome' => '/LMS/Outcome', ), '9' => array( 'Accounts' => '/LMS/Accounts', ) ); $access = array ( 'pages_id' => array ( 0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 8, 5 => 9 ), ); print_r(array_intersect_key($data['menus'], array_flip($access['pages_id'])));

preferences:
47.18 ms | 402 KiB | 5 Q