PHP Simple implementation of multi-byte string flipping method
In this paper, we describe a simple way to implement multi-byte string flipping in PHP. Share to everyone for your reference. The implementation method is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 |
function Mb_strev ($string, $encoding = null) { if ($encoding = = = null) { $encoding = mb_detect_encoding ($string); } $length = Mb_strlen ($string, $encoding); $reversed = "; while ($length--> 0) { $reversed. = Mb_substring ($string, $length, 1, $encoding); } return $reversed; } |
http://www.bkjia.com/PHPjc/977158.html www.bkjia.com true http://www.bkjia.com/PHPjc/977158.html techarticle PHP Simple implementation of multi-byte string flipping method in this paper, we describe a simple way to implement multi-byte string flipping in PHP. Share to everyone for your reference. The concrete implementation method is as follows: ...