简体   繁体   中英

PHP Normalizer: Fatal error: Class 'Normalizer' not found

I am trying to normalise a string, but it gives an error,

Fatal error: Class 'Normalizer' not found in C:xx.php on line xx

As far as I understand I just need to do this if I want to use the Normalizer class,

$string = "Löic & René";
$normalise = Normalizer::normalize($string);

I have turned on the php extension which is php_intl . is there anything else I should turn on to use this type of class? or have I done something incorrectly?

I even tried this code from php.net but I have the same error,

$char_A_ring = "\xC3\x85"; // 'LATIN CAPITAL LETTER A WITH RING ABOVE' (U+00C5)
$char_combining_ring_above = "\xCC\x8A";  // 'COMBINING RING ABOVE' (U+030A)

$char_1 = Normalizer::normalize( $char_A_ring, Normalizer::FORM_C );
$char_2 = Normalizer::normalize( 'A' . $char_combining_ring_above, Normalizer::FORM_C );

echo urlencode($char_1);
echo ' '; 
echo urlencode($char_2);

Any ideas?

I am on Wamp server 2.2.11 by the way.

Thanks.

you need PHP 5 >= 5.3.0 for this reason

do you restarted your web service?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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