I have this
$ids = array_map(array($this, 'myarraymap'), $data['student_teacher']);
function myarraymap($item) {
return $item['user_id'];
}
I will would like to put an other parameter to my function to get something like
function myarraymap($item,$item2) {
return $item['$item2'];
}
Can someone can help me ? I tried lots of things but nothing work
Apart from creating a mapper object, there isn’t much you can do. For example:
And then inside your function, instead of creating your own mapper, use the new class:
This will allow you to create a custom mapper that can return any kind of information… And you can complexify your customMapper to accept more fields or configuration easily.