您现在的位置:IT之家 >> 学院>> 程序开发教程>> PHP教程 >> 正文内容
同级栏目:
ASP.NET教程ASP教程PHP教程JSP教程Perl教程PowerBuilder教程XML教程Visual C++教程c#教程Visual Basic教程JAVA教程C++ Builder教程C++教程Delphi教程shell教程NoahWeb教程移动开发教程
>内容阅读:

非常有用却不常见的PHP函数

作者: 来源: 时间:2010年02月04日 【字体:
=> 5 apples
# [3] => 55 apples
# )
natsort($items);
print_r($items);
# Outputs:
# Array
# (
# [2] => 5 apples
# [3] => 55 apples
# [0] => 100 apples
# [1] => 110 apples
# )




9. levenshtein()

Levenshtein()告诉你两个单词之间的“距离”。它告诉你如果想把一个单词变成另一个单词,需要插入、替换和删除多少字母。

看个例子吧:




$dictionary = array(
“php”, “Javascript”, “Css
);
$word = “japhp”;
$best_match = $dictionary[0];
$match_value = levenshtein($dictionary[0], $
共5页 您在第4页 首页 上一页 1 2 3 4 5 下一页 尾页 跳转到页 本页共有900个字符