Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. ...
  2.  
  3. $searchString = isset($_GET['q']) ? $_GET['q'] : null;
  4.  
  5. $users = User::getByLimitedDomains();
  6.  
  7. if (!empty($searchString)) {
  8. $users->search(
  9. function($user) use ($searchString) {
  10. /** @var User $user */
  11. return preg_match('/(.*)'.$searchString.'(.*)/i', $user->getEmail()) === 1; // case insensitive search
  12. }
  13. );
  14. }
  15.  
  16. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement