現在の位置: ホーム> 関数カテゴリ一覧> similar_text

similar_text

2つの文字列間の類似性を計算します
名前:similar_text
カテゴリ:
対応言語:php
一言説明:2つの文字列の類似性を計算します。

例1

2つの文字列の類似性を計算し、一致する文字の数を返します。

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">sigral_text</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"hello world"</span> <span class="token punctuation">、</span> <span class="token string double-quoted-string">"hello shanghai"</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

自分で試してみてください

例2

2つの文字列間の類似性の割合を計算します。

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token function">Sigral_text</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"Hello World"</span> <span class="token punctuation">、</span> <span class="token string double-quoted-string">"Hello Shanghai"</span> <span class="token punctuation">、</span> <span class="token variable">$パーセント</span><span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token keyword">エコー</span><span class="token variable">$パーセント</span><span class="token operator">。</span> <span class="token string double-quoted-string">「%」</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

自分で試してみてください

類似の関数
  • バックスラッシュを使用して文字列をエスケープします addslashes

    addslashes

    バックスラッシュを使用して文字列をエスケ
  • 特殊文字をHTMLエンティティに変換します htmlspecialchars

    htmlspecialchars

    特殊文字をHTMLエンティティに変換しま
  • 論理 -  hebrewをビジュアルヘブライ語に変換し、Newlinesを変換します hebrevc

    hebrevc

    論理-hebrewをビジュアルヘブライ語
  • ターゲット文字列の指定された文字列の最後の発生を計算します strrpos

    strrpos

    ターゲット文字列の指定された文字列の最後
  • UUENCODEエンコードされた文字列をデコードします convert_uudecode

    convert_uudecode

    UUENCODEエンコードされた文字列を
  • パージは、指定された形式に従って文字に入力されました sscanf

    sscanf

    パージは、指定された形式に従って文字に入
  • 16進数文字列をバイナリ文字列に変換します hex2bin

    hex2bin

    16進数文字列をバイナリ文字列に変換しま
  • htmlspecialchars()およびhtmlentities()を使用した後、変換テーブルを返します get_html_translation_table

    get_html_translation_table

    htmlspecialchars()およ
人気記事(にんききじ)