get_input('field'), 'results' => array() ); if (get_input('action') == 'suggest') { $search = get_input('value'); $limit = (int) get_input('limit'); $users = search_for_user($search, $limit, 0, "", false); foreach ($users as $us) { $res['results'][] = array($us->guid, $us->name); } } else { // Do nothing } echo json_encode($res); ?>