|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
How to use regular expression to escape symbols?
hello everyone:
I want to read data from a CSV file and import the data into database table. the data may contain pound sign, underscore and forward slash. sample data from the CSV file: EC316UA#AGS, QV2K4-4E58Q-36GFA-QB86J, N/A a) shall I search these symbols one at a time (escape them one at a time) or I can search all three symbols at once and escape the them at the same time? I am thinking use ereg_replace() to match the symbols, escape them and insert the data into table. Please give me some advises on how to accomplish this, I appreciate your help! |
|
#2
|
|||
|
|||
|
# _ and / are not special characters. They do not need to be escaped.
If you need to escape anything use mysql_real_escape_string. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > How to use regular expression to escape symbols? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|