Php converts all-round characters in a string to half-width characters.
Php converts the full-byte character in the string to a half-width character from ecshop.
/*** Enclose a string with full-width numbers, letters, spaces, or '% + -() 'character conversion to the corresponding halfwidth character * @ access public * @ param string $ str string to be converted * @ return string $ str string after processing */function make_semiangle ($ str) {$ arr = array ('0' => '0', '1' => '1', '2' => '2 ', '3' => '3', '4' => '4', '5' => '5', '6' => '6 ', '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' => 'l', 'M' => 'M', 'n' => 'n ', 'o' => 'O', 'p' => 'P', 'q' => 'Q', 'R' => 'R ', 'S '=>'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' =>'s ', 't' => 'T', 'U' => 'U ', 'V' => 'V', 'w' => 'w', 'x' => 'x', 'y' => 'y ', 'Z' => 'Z', '(' => '(', ')' => ')', '[' => '[', ']' => ']', '[' => '[', ']' => ']', '<' => '[', '〗' => ']', '"' => '[', '"' => ']', '\ ''=> '[', '\ ''=>'] ',' {'=>' {','} '=>'} ',' => '<', '"' => ',' % '=>' % ',' + '=>' + ','-'=> '-', '-' => '-','~ '=>'-',': '=> ':','. '=> '. ',', '=>', '=> '. ',', '=> '. ','; '=> ',','? '=> '? ','! '=> '! ','... '=>'-', ''' =>' | ',' "'=>'" ',' \ ''=> ''', '\ ''=> ''',' | '=>' | ', 'Region' =>'" ', ''=> ''); return strtr ($ str, $ arr );}
Articles you may be interested in
- Php converts multiple consecutive spaces in a string into one.
- How does php convert the br line breaks in html to line breaks in text input?
- How does js convert the returned string to json format data?
- Note the following when querying strings with single quotes and inserting strings with single quotes in Mysql:
- Php determines whether the string is full of English, pure Chinese, and a combination of Chinese and English
- Php function converts hexadecimal color code to RGB color value
- Php obtains the character length of the utf8 string
- Js array to string, js string to array method summary