This is a function for converting a full-width symbol to a half-width symbol found on the Internet. it is valid when used. The principle is that the second byte of Chinese punctuation minus 0X80 (that is, 128) the resulting number is the half-width number, but it still does not meet my needs. I want to convert the full-width symbol into a half-width symbol from a piece of text without converting the text.
Original article: If I cannot protect the most important people around me, what is the significance of my role as a demon.
If I cannot protect the most important people around me, what is the significance of my role as a demon.
It is also necessary to convert the strings in the text into an array. for example, if the array is used, it is converted into a half-width corner and then the text is formed.
Your method is good, but it's complicated. look at me.
$ Arr1 = ["1", "2", "3", "A", "B", "C", "D", "F", "W ", "S ","\",""",",",". ","? "," <","> "," {","} "," [","] "," * "," & "," ^ ", "% ","#","@","! ","~ "," (",") "," + ","-"," | ",":",";",". "]; $ Arr2 = [" 1 "," 2 "," 3 "," A "," B "," C "," D "," F ", "W", "S ","\\","\"",",",". ","? "," <","> "," {","} "," [","] "," * "," & "," ^ ", "% ","#","@","! ","~ "," (",") "," + ","-"," | ",":",";",". "]; $ Str =" if I cannot protect the most important people around me, what is the significance of my role as a demon. "; Echo $ str ."
"; For ($ I = 0; $ I
Running result
If I cannot protect the most important people around me, what is the significance of my role as a demon. If I cannot protect the most important people around me, what is the significance of my role as a demon.