国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 建站經驗 > 正文

php比-較相似字符串的方法

2019-11-02 14:15:24
字體:
來源:轉載
供稿:網友

   本文實例講述了php比較相似字符串的方法。分享給大家供大家參考。具體分析如下:

  這里通過php的similar_text函數比較兩個字符串的相似性。

  ?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 $word2compare = "stupid"; $words = array( 'stupid', 'stu and pid', 'hello', 'foobar', 'stpid', 'upid', 'stuuupid', 'sstuuupiiid', ); while(list($id, $str) = each($words)){ similar_text($str, $word2compare, $percent); print "Comparing '$word2compare' with '$str': "; print round($percent) . "%n"; } /* Results: Comparing 'stupid' with 'stupid': 100% Comparing 'stupid' with 'stu and pid': 71% Comparing 'stupid' with 'hello': 0% Comparing 'stupid' with 'foobar': 0% Comparing 'stupid' with 'stpid': 91% Comparing 'stupid' with 'upid': 80% Comparing 'stupid' with 'stuuupid': 86% Comparing 'st
  希望本文所述對大家的php程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 纳雍县| 廊坊市| 南木林县| 同德县| 嘉禾县| 海阳市| 贵港市| 濮阳县| 绵阳市| 临高县| 宁陵县| 金华市| 黎川县| 五指山市| 康定县| 汾阳市| 宣化县| 永寿县| 平远县| 政和县| 中西区| 蕉岭县| 花莲市| 鹤山市| 民和| 岢岚县| 荥阳市| 漯河市| 湖口县| 三穗县| 甘洛县| 梅州市| 盱眙县| 清河县| 秦安县| 赣州市| 六枝特区| 旅游| 偏关县| 邯郸市| 宝山区|