How does the php program avoid the interval number in a string?

Source: Internet
Author: User
How does the php program process the interval number in a string? I want to process a string and assign it to the variable to access the database, but the system always fails. When an interval number exists in a string, data after the interval number cannot be inserted. Process the English or numbers in the string. The problem is that there may be Chinese characters and separators in such strings! I want to replace this number with other symbols (single-byte symbols) when encountering an interval number. how can I determine this delimiter in the PHP program? & Nbsp; (how does the php program process the interval number in a string?
I want to process a string and assign it to the variable to access the database, but the system always fails. When an interval number exists in a string, data after the interval number cannot be inserted. Process the English or numbers in the string. The problem is that there may be Chinese characters and separators in such strings! I want to replace this number with other symbols (single-byte symbols) when encountering an interval number)
How can I determine this delimiter in a PHP program? (Ascii code A1A4 ). I searched the internet for half a day. Find only one php idea for processing Chinese characters

1. convert characters into ASCII (ord function) one by one to get the variables;
2. determine whether a variable belongs to a Chinese character
3. skip one character if it is a Chinese character and then judge the next one.
4. skip one character if it is not a Chinese character.
The question is how to determine the interval number?

Are there other methods?
------ Solution ----------------------
Addslashes ($ str)
Use a function to process the string to be added to the database. no error will occur when you add the string to the database.

------ Solution ----------------------
I have used fusioncharts and it feels good. There are basic graphics.
------ Solution ----------------------
Impossible!
To solve the problem, you need to view your code and data.
------ Solution ----------------------
How is your interval number defined? Simply find the character and replace it.
------ Solution ----------------------
If the data cannot be written to the database, you need to check your SQL statement. The second is whether the data format you want to insert meets the requirements. generally, if you do not need to replace it, the data can be successfully written to the database after conversion, otherwise, the rich text editor cannot be used?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.