+ -
当前位置:首页 → 问答吧 → 請問learn jquery 裡面的autocomplete如何支持中文阿?

請問learn jquery 裡面的autocomplete如何支持中文阿?

时间:2009-05-05

来源:互联网

裡面的array原本是英文的
我改成中文的卻不顯示了

复制代码
  1. <?php
  2. if (strlen($_REQUEST['search-text']) < 1) {
  3.   print '[]';
  4.   exit;
  5. }
  6. $terms = array(
  7.   '中文',
  8. );
  9. $possibilities = array();
  10. foreach ($terms as $term) {
  11.   if (strpos($term, strtolower($_REQUEST['search-text'])) === 0) {
  12.     $possibilities[] = "'". str_replace("'", "\\'", $term) ."'";
  13.   }
  14. }
  15. print ('['. implode(', ', $possibilities) .']');
  16. ?>

作者: awelkije   发布时间: 2009-05-05

相关阅读 更多