Jump to content

[SOLVED] Replacing %#^*_(/)';-" etc....


PHPNewbie55

Recommended Posts

I am trying to import CSV data into a MySQL database.

 

The only problem I have is that some of the data contains characters that give MySQL Errors,

such as %#^*_(/)';-" etc....

 

What would be the best way to strip all of that out without using a str_replace("", "", data[2])?

I do not want to str_replace anything.. because it would be impossible for me to add a str_replace for every character (because I don't know what they are going to be)...

 

So what would you suggest..??

 

htmlentities()

htmlspecialchars()

addslashes()

 

Or something else...??

Link to comment
https://forums.phpfreaks.com/topic/84774-solved-replacing-_-etc/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.