PDA

View Full Version : What is the function that puts \ to escape characters?


kobescoresagain
03-11-2006, 12:56 AM
I need to put \ in front of all ' characters in a string. I know there is a function to do this. I just don't know what it is called, and tried google, but wasn't sure what it was called to search for it.

Adrian Schneider
03-11-2006, 12:56 AM
addslashes() ?

Trigunflame
03-11-2006, 01:01 AM
I need to put \ in front of all ' characters in a string. I know there is a function to do this. I just don't know what it is called, and tried google, but wasn't sure what it was called to search for it.

Always go to php.net if you need help with PHP functions, they have great documentation.

kobescoresagain
03-11-2006, 01:03 AM
I did go there, I just wasn't sure what it was called, so it was kinda hard to figure it out. But it is add slashes. I figured it would have been called something else.

filburt1
03-11-2006, 01:04 AM
If it's for database insertion, there's a standardized way to do it via the database wrapper class in vB. Then again, since 99.9 (overbar) % of installations use MySQL as it is, it makes it somewhat pointless, especially given it essentially is a wrapper for addslashes itself.

Trigunflame
03-11-2006, 01:16 AM
I did go there, I just wasn't sure what it was called, so it was kinda hard to figure it out. But it is add slashes. I figured it would have been called something else.

Like I said, they have a great "Documentation", view the documentation. They have it categorized:

http://us2.php.net/manual/en/ref.strings.php

For example.