php pass variable to array_map code example
Example: php array_map passing parameters
function myarraymap($item,$item2) {
return $item[$item2];
}
$param = 'some_value';
$ids = array_map(
function($item) use ($param) { return myarraymap($item, $param); },
$data['student_teacher']
);