AJAX
[ class tree: AJAX ] [ index: AJAX ] [ all elements ]

Source for file livesearch.class.php

Documentation is available at livesearch.class.php

  1. <?php
  2. /**
  3.  * Simple test class for doing fake livesearch
  4.  *
  5.  * @category   HTML
  6.  * @package    AJAX
  7.  * @author     Joshua Eichorn <josh@bluga.net>
  8.  * @copyright  2005 Joshua Eichorn
  9.  * @license    http://www.opensource.org/licenses/lgpl-license.php  LGPL
  10.  * @version    Release: @package_version@
  11.  * @link       http://pear.php.net/package/HTML_AJAX
  12.  */
  13. class livesearch {
  14.     /**
  15.      * Items to search against
  16.      */
  17.     var $livesearch = array(
  18.         'Orange',
  19.         'Apple',
  20.         'Pear',
  21.         'Banana',
  22.         'Blueberry',
  23.         );
  24.     
  25.     /**
  26.      * Perform a search
  27.      *
  28.      * @return array 
  29.      */
  30.     function search($input{
  31.         $ret = array();
  32.         foreach($this->livesearch as $key => $value{
  33.             if (stristr($value,$input)) {
  34.                 $ret[$key$value;
  35.             }
  36.         }
  37.         return $ret;
  38.     }
  39. }
  40. ?>

Documentation generated on Mon, 11 Mar 2019 14:11:19 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.