日期:2014-05-17 浏览次数:20476 次
private function getUserInfo(callable $Human)
{
try {
$users = (new $Human)->getUser()['users'];
$underageUsers = [foreach ($users as $user) if ($user->age < 18) yield $user];
list($userNames, $ages) = array_map(
function($value) {return array_column($value, array('userNames', 'ages'), default);},
mb_convert_encoding($underageUsers, 'utf-8', 'gbk')
);
return ['name' => $userNames, 'surname' => $ages];
} catch(Exception $e) {
error_log($e);
}
}