如何将字串里的小写全部转成大写,但不破坏中文字
如何将字串里的小写全部转成大写,但不破坏中文字
---摘自互联网
用preg_replace()即可轻易解决:
<?
$str="english and 中文字 Word";
$str=preg_replace(’/[
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/ftp/n/q/h/6/qh663/php/show.php on line 46
x0-
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/ftp/n/q/h/6/qh663/php/show.php on line 46
x9f][a-z]+/e’,"strtoupper(’\\0’)",$str);
echo $str;
?>