I am getting the following
Notice: Use of undefined constant ARRAY_FILTER_USE_BOTH - assumed 'ARRAY_FILTER_USE_BOTH' in C:\projects\yada.php on line 88
Warning: array_filter() expects at most 2 parameters, 3 given in C:\projects\yada.php on line 88
Notice: Use of undefined constant ARRAY_FILTER_USE_BOTH - assumed 'ARRAY_FILTER_USE_BOTH' in C:\projects\yada.php on line 91
Warning: array_filter() expects at most 2 parameters, 3 given in C:\projects\yada.php on line 91
The code is as follows
$unregistered_team_names = array_filter($data, function ($v, $k) {
return strpos($k, 'unregistered_user_name_') !== false;
}, ARRAY_FILTER_USE_BOTH);
$unregistered_team_emails = array_filter($data, function ($v, $k) {
return strpos($k, 'unregistered_user_email_') !== false;
}, ARRAY_FILTER_USE_BOTH);
The code seems valid as per the documentation provided here - http://php.net/manual/en/function.array-filter.php
THe callback never gets called.