File: friends.php

Recommend this page to a friend!
  Classes of Igor Crevar   jQuery Facebook Autocomplete   friends.php   Download  
File: friends.php
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: jQuery Facebook Autocomplete
Autocomplete text using AJAX like Facebook
Author: By
Last change: fix plugin so it now works with jquery 1.11.1. refactor a little. Made better example and delete bunch of stupid files. Ofcourse, better readme
Date: 2 years ago
Size: 689 bytes
 

Contents

Class file image Download
<?php $term = isset($_GET['term']) ? $_GET['term'] : ''; //TODO: you should retrieve this list from database //list of users $allUsers = array( array('id' => 20, 'title' => 'Dan Wellman'), array('id' => 10, 'title' => 'Igor Crevar'), array('id' => 30, 'title' => 'Abcdef John'), array('id' => 40, 'title' => 'Qwerty Symon'), array('id' => 50, 'title' => 'Jon Lajoie'), array('id' => 60, 'title' => 'Fifth Beatles'), array('id' => 70, 'title' => 'Bree Olson'), array('id' => 80, 'title' => 'Mark Zuckerberg') ); $users = array(); foreach ($allUsers as $user) { if (stripos($user['title'], $term ) !== false) { $users[] = $user; } } //generate output echo json_encode($users);