We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

eeppeliteloop on 03/23/08


Tagged

slashes quote quotes magic slash


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

mb


Remove slashes function


Published in: PHP 


Removes the automatic slashes from POST & GET data if it finds Magic Quotes is activated.

  1. function remSlash($varvar) {
  2. $varRem = stripslashes($varvar);
  3. }
  4. else {
  5. $varRem = $varvar;
  6. }
  7.  
  8. return $varRem;
  9. }
  10.  
  11. // Ex.: $no_slash = remSlash($_POST['name']);

Report this snippet 

You need to login to post a comment.