This article mainly introduces the PHP full-width half-width conversion function, the current can find all the full-width is listed to replace it, the need for friends can refer to the next
I've tried to find a lot of puzzling problems by replacing them with ASCII and other characters. Finally, the following character substitution method, the current can find all the full-width of a list of the code as follows:/** * Full-width character converted to half-width * * @param string $STR * @return String */Public function Sb C2DBC ($str) {$arr = array (' 0 ' = ' 0 ', ' 1 ' = ' 1 ', ' 2 ' = ' 2 ', ' 3 ' = ' 3 ', ' 4 ' = ' 4 ', ' 5 ' = ' 5 ', ' 6 ' = ' 6 ' and ' 7 ') = ' 7 ', ' 8 ' = ' 8 ', ' 9 ' = ' + ' 9 ', ' a ' = = ' A ', ' b ' = = ' B ', ' c ' = ' C ', ' d ' = ' d ', ' e ' = ' e ', ' f ' = ' = ' f ', ' g ' = > ' G ', ' h ' = ' h ', ' i ' = = ' I ', ' j ' = = ' J ', ' k ' = ' k ', ' l ' = ' = ', ' m ' = ' = ', ' n ' = ' n ', ' o ' = ' o ', ' p ' = > ' P ', ' q ' + = ' q ', ' r ' + = ' r ', ' s ' + = ', ' t ' = ' t ', ' u ' = ' u ', ' v ' = ' = ' V ', ' W ' = = ' W ', ' x ' + ' x ', ' y ' = > ' Y ', ' z ' + = ' z ', ' a ' = = ' A ', ' b ' = = ' B ', ' c ' = ' = ' c ', ' d ' + ' d ', ' e ' = ' e ', ' f ' = ' f ', ' g ' = ' g ', ' h ' = > ' h ', ' i ' = ' I ', ' j ' = ' j ', ' k ' = ' k ', ' l ' = ' ' l ', ' m ' = = ' m ', ' n ' = = ' n ', ' o ' = = ' o ', ' p ' = ' P ', ' q ' = > ' q ', ' r ' = ' R ', ' s ' and ' s ', ' t ' and ' t ', ' u ' = ' ' u ', ' V ' + ' V ', ' w ' = = ' W ', ' x ' = ' x ', ' y ' = > ' z ', ' (' = ' (', '' = ' + ') ', ' (' = ' = ' (') ', ' ' + ') ', ' ' ' ' ' ' ' [', ' ' ' ' ' + '] ', ' ' ' + ' ' [', ' ' ' + '] ', ' ' ' ' + ' ' ', ' ' ' = ' \ ', ' ' + ' ', ' ' + ' ', ' {' = ', ' '} ', ' + ', ' ' ' = ' < ', ' ' = ' > ', '% ' = '% ', ' + ' + ' + ', '-' = ' + ' -', '-' + '-', ' ~ ' = ' ~ ', ': ' = ': ', '. ' = = ', ', ', ' = = ', ', ', ' = = ', ', ', ' = = ', ', '; ' ' = = '? ', '! ' = = '! ' = '-'-', ' ‖ ' and ' | ', ' ' ' ' ' ' ' ' ' ' ', ' ' ' + ' ', ' ' ' + ' ', ' | ' + ' | ', ' ' = ', ' ', ' ' ' ' gt; ' * ', '  ̄ ' = ' ~ ', '. ' = = ', ' * ' = ' * ', ' + ' and ' = ' & ', ' ' = ' < ', ' ' and ' = ' > ', ' $ ' + ' $ ', ' @ ' + ' @ ', ' ^ ' + ' ^ ', ' _ ' = > ' _ ', ' ' ' + ', ' ', ' ¥ ' = ' $ ', ' = ' = ' = ' = ', ' \ ' = ', ' ' \ ' = '; Return Strtr ($str, $arr); }
http://www.bkjia.com/PHPjc/730224.html www.bkjia.com true http://www.bkjia.com/PHPjc/730224.html techarticle This article mainly introduces the PHP full-width half-width conversion function, the current can find all the full-width is listed to replace it, the need for friends can refer to the online search before the pass ...