PHP致命错误:尽管有PHP 5.3.24,但找不到类'Collator' [英] PHP Fatal error: Class 'Collator' not found despite PHP 5.3.24
问题描述
我的输出是:" PHP致命错误:未找到类'Collator'
".
my output after code below is: "PHP Fatal error: Class 'Collator' not found
".
我已阅读 php手册,该手册用于COLLATOR类
,PHP版本必须为PHP 5> = 5.3.0.我的PHP版本是5.3.24.
I've read in php manual that for COLLATOR class
, PHP version needs to be PHP 5 >= 5.3.0. My PHP version is 5.3.24.
在我的 phpinfo()
中,我搜索了'coll'字符串,但未找到任何内容.
in my phpinfo()
I searched 'coll' string but nothing is found.
还请注意,我的网站语言是土耳其语,我使用的是 UTF-8
also please note that my site lang is Turkish and I am using UTF-8
那么我致命错误输出的原因是什么?谢谢.
So what is the reason for my fatal error output? Thanks.
/* fetch values */
$etiket_bulutu = '';
while ($beyan->fetch())
{
$etiket_bulutu .= $tags.', ';
}
$etiket_bulutu = substr_replace($etiket_bulutu ,'',-2); //omit last {, } chars
$etiketler = explode(", ", $etiket_bulutu); //get each tag as arr
$etiketler = array_unique($etiketler);
$etiketler = array_values($etiketler); //only unique tags without NULLs
$etadet = count($etiketler);
$coll = collator_create('tr_TR'); //from http://www.php.net/manual/en/collator.sort.php
collator_sort($coll, $etiketler);
for($x=0;$x<$etadet;$x++)
{
echo $etiketler[$x];
echo "<br />";
}
推荐答案
在手册中,请注意该类是intl扩展的一部分.请参阅安装说明中的国际说明,并注意需要明确安装使用-enable-intl
和/或可能需要ICU库,具体取决于系统.检查您的PHP安装是否已安装intl.
In the manual, note that the class is part of the intl extension. See the Installation Instructions for intl and note that it needs to be explicitly installed using --enable-intl
and/or may require the ICU library, depending on the system. Check your PHP installation whether intl is installed or not.
这篇关于PHP致命错误:尽管有PHP 5.3.24,但找不到类'Collator'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!