简体   繁体   English

我的PHP找不到'normalizer_normalize()'函数,为什么?

[英]My php can't find 'normalizer_normalize()' function, why?

How come I can't use normalizer function? 为什么不能使用规范化功能?

I am using it exactly as I should, ie: $var = normalizer_normalize($str); 我完全按照我的方式使用它,即:$ var = normalizer_normalize($ str);

I get php error: no such function! 我得到php错误:没有这样的功能!

Here is the code: 这是代码:

 $headline= mysql_real_escape_string($_POST['headline']);
 $ad_id_string=normalizer_normalize($headline);

Thanks 谢谢

From the docs , normalizer_normalize was included in PHP as of version 5.3.0. 从文档开始 ,PHP自5.3.0版开始包含normalizer_normalize Prior to that, it was available as a PECL extension. 在此之前,它可以作为PECL扩展使用。 To build it as part of PHP, you'll need to install internationalization support. 要将其构建为PHP的一部分,您需要安装国际化支持。

If you need to provide your own equivalent to the Normalizer class, strtr() would be a good option. 如果需要提供自己的与Normalizer类等效的类,则strtr()将是一个不错的选择。 The only downside is that you will need to provide your own character strings to translate to / from. 唯一的缺点是您将需要提供自己的字符串以进行翻译。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM