Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- $searchString = isset($_GET['q']) ? $_GET['q'] : null;
- $users = User::getByLimitedDomains();
- if (!empty($searchString)) {
- $users->search(
- function($user) use ($searchString) {
- /** @var User $user */
- return preg_match('/(.*)'.$searchString.'(.*)/i', $user->getEmail()) === 1; // case insensitive search
- }
- );
- }
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement