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?
精彩评论