0

@see: (on mac os):

developer:php $ php -v

PHP 5.5.24 (cli) (built: Apr 27 2015 11:18:18) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

developer:php $ php -r "echo ucfirst('the test') . PHP_EOL;"

The test

developer:php $ php -r "echo ucfirst('中文') . PHP_EOL;"

ĸ?文 <<<<

Please help me , 3Q!

PS: php5.6 is same!

Ryan
  • 1
  • 1

1 Answers1

0

I think this is a charset encoding thing where you need a multi-byte function. This other question says there is no mb_ucfirst but has a solution listed:

ucfirst() function for multibyte character encodings

Community
  • 1
  • 1
Jason Byrne
  • 1,579
  • 9
  • 19
  • why my friends are OK in! and i test some php version, port install and source installed, then are same problem. – Ryan Apr 27 '15 at 09:47