Search code examples
phplanguage-detection

Detect language from string in PHP


In PHP, is there a way to detect the language of a string? Suppose the string is in UTF-8 format.


Solution

  • You can not detect the language from the character type. And there are no foolproof ways to do this.

    With any method, you're just doing an educated guess. There are available some math related articles out there