ÓÃphpʵÏÖÖÐÎÄ×Ö·û´®µÄ·´×ª
phpÖÐÄÚÖõĺ¯Êýstrrev()Ö»ÄÜ·´×ªÓ¢ÎĵÄ×Ö·û£¬ÔÚ·´×ªÖÐÎÄ×Ö·ûµÄʱºòÒòΪ±àÂëµÄÎÊÌâ¾Í»á²úÉúÂÒÂë¡£
Òò´ËÖ»ÄÜ×Ô¶¨Ò庯ÊýÀ´ÊµÏÖÁË¡£Ë¼Â·ÈçÏÂ
1¡¢½«utf8±àÂëµÄÖÐÎÄ×Ö·ûÖð¸ö¶Á³ö·Åµ½Êý×éÖС£
2¡¢½«Êý×鷴ת¡£
3¡¢½«·´×ªºóµÄÊý×éÆ´½ÓΪ×Ö·û´®£¬·µ»Ø
´úÂëÈçÏ£º
<?php /* ´Ëº¯ÊýµÄ×÷ÓÃÊÇ·´×ªÖÐÎÄ×Ö·û´® mb_strlen() »ñÈ¡×Ö·ûµÄ³¤¶È mb_substr() »ñÈ¡×Ö·ûµÄµ¥¸öÔªËØ krsort() °´ÕÕ¼üÖµÄæÐòÅÅÐòÊý×é implode() ½«Êý×éÆ´½ÓΪ×Ö·û´® explode() ʹÓÃ×Ö·û´®·Ö¸ô×Ö·û´® */ function str_rev_gb($str, $charset='gbk'){ /*ÅжÏÊäÈëµÄÊDz»ÊÇutf8ÀàÐ͵Ä×Ö·û£¬·ñÔòÍ˳ö */ if(!is_string($str)||!mb_check_encoding($str, $charset)){ return $str; } $array=array(); /*½«×Ö·û´®´æÈëÊý×é */ $l=mb_strlen($str, $charset); for($i=0;$i<$l;$i++){ $array[]=mb_substr($str,$i,1,$charset); } /*·´×ª×Ö·û´® */ krsort($array); //print_r($array); /*Æ´½Ó×Ö·û´® */ $string=implode($array); return $string; } $str="lucy,ÇëÎÒÎÒ³Ô·¹°É£¬½ñÌìÎÒ¸ßÐË"; //$str=12345; //$str="hello,beautiful!"; echo str_rev_gb($str); ?>
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ