Location: PHPKode > projects > OpenBizMap > obm2007.1/mydata/script/sys_suggest.txt
<?php
    header("Content-Type: text/plain; charset=UTF-8");

    $dict=get('dict');
    $start=get('start');

    $dictionary_array=array();

    $dictionary_array=search_dictionary($dict,$start);

    $suggestions = array();
    if(strlen($start)>0)
    {
      for ($ii=0; $ii < count($dictionary_array); $ii++)
      {
        if(stristr('_'.$dictionary_array[$ii],$start))
          $suggestions[]=$dictionary_array[$ii];
          //$suggestions[]=$start.substr($dictionary_array[$ii], strlen($start));
        if(count($suggestions)>10)
          break;
      }
    }
    else
    {
      for ($ii=0; $ii < count($dictionary_array); $ii++)
      {
        $suggestions[]=$dictionary_array[$ii];
        if(count($suggestions)>10)
          break;
      }
    }

  echo '[';
    for ($ii=0;$ii<count($suggestions);$ii++)
    {
        if ($ii > 0) {
            echo ",";
        }
        echo "\"".$suggestions[$ii]."\"";
    }
  echo ']';
  exit;
?>
Return current item: OpenBizMap