Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: PHP の文字列から言語を検出する
ユーザー入力文字列の言語を検出するにはどうすればよいですか?
たとえば、次の文字列です。
בדיקה בלה בלה heb אחד שתים שלוש
結果が得られます:ヘブライ語
10倍!
最も簡単な方法は、文字列を辞書のデータベースと比較することです。単語が含まれている辞書に応じて、言語を見つけることができます。
ただし、注意事項