I'm going to work with a string that assigns the string to the variable to access the database, but the system always goes wrong. When there is an interval number in a string, the data after the interval number cannot be inserted. Handle the English or digital good in this string. The problem is that in this type of string, there may be kanji and spacer characters! I want to replace this number with other symbols (single-byte symbols) when I hit the interval number.
How do I judge this spacer in a PHP program? (ASCII code A1A4). I've been searching the internet for half a day. Only to find a way to deal with the Chinese characters php
1. The character is converted into ASCII (ORD function) into the variable;
2. Determine if the variable belongs to Chinese characters
3, if it belongs to Chinese characters, skip a character, then judge the next
4. Skips a character if it is not a kanji character.
The question is how to judge the interval number?
Is there any other way?
Reply to discussion (solution)
Addslashes ($STR)
To the string to be added into the database with the function of processing, join the database will not be wrong
Fusioncharts I used to feel good, basic graphics have
No way!
To solve the problem, you need to see your code and data
How do you define the interval number? Just find the character and replace it.
Data is not written to the database you have to look at your SQL statement, followed by the data format you want to insert is satisfied, generally this does not need to replace as long as the conversion can be successfully written to the database, or Rich text editor that is not to use it?
Finally, by setting the character set to solve the problem, the original character set does not know "spacer", what function is not good, and finally changed the character set, just fine