从PHP中的字符串检测语言 [英] Detect language from string in PHP

查看:90
本文介绍了从PHP中的字符串检测语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在PHP中,有没有一种方法可以检测字符串的语言?假设该字符串为UTF-8格式.

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

推荐答案

您无法从字符类型中检测语言.而且没有万无一失的方法来做到这一点.

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

这篇关于从PHP中的字符串检测语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆