The $char
in your matches
function is undefined. (If it is a global variable, then you have to add global $char;
first.)
Or do like below:
$result = array_filter($users, function ($var) use ($char) {
return stripos($var["User"]["username"].$var["User"]["fullname"], $char) !== false;
});