Question about 2 String functions

0 dor sarel · May 15, 2015
hii,

in tutorial number 37, alex explained about the functions:
addslashes && stripslashes,
i didnt understand what the idea behind those 2 functions.

if someone can give me an explain it will be great!
thank you :)

Post a Reply

Replies

Oldest  Newest  Rating
0 Logan Lohman · May 17, 2015
This example is taken directly from the PHP manual:

Stripslashes:


$str = "Is your name O\'reilly?";

// Outputs: Is your name O'reilly?
echo stripslashes($str);

 Addslashes:

$str = "Is your name O'Reilly?";

// Outputs: Is your name O\'Reilly?
echo addslashes($str);

If you want to read more about these two functions check them out on the PHP manual.
0 dor sarel · May 18, 2015
I understood what these 2 are doing, but I didn't understand the purpose 
I which case I will be needed to use them?

Tnx!
  • 1

PHP

107,221 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators