我想比较三个字符串:检查字符串为x%等于
"a text string" //target string
"a kind of similar text string"
"the cow jumps over the moon"
,并设置返回的结果的百分比参数x%相似的目标。
$results = compare($array,$target,80)
$results // Returns an array with str 1,2, because they are at least 80 similar to the target.
此外,是一个类似的功能可能在JavaScript或jQuery?
+1 - 同样的理由,在我下面的评论。 – Cyclonecode 2012-04-13 21:25:34
@KristerAndersson:'compare'实际上并不是一个PHP函数。 – 2012-04-13 21:26:12
@火箭 - 不,我的意思是'similar_text',变得有点困惑,尽管我正在给你写评论。无论如何,这个问题很好,所以+1。 – Cyclonecode 2012-04-13 21:29:06