/ Published in: PHP
A snippet that allows you to easily clean up your code, done in one go by passing though a series of validations
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// This function is used to clean POST variables. function clean($value) { // If magic quotes not turned on add slashes. // Adds the slashes. // Strip any tags from the value. // Return the value out of the function. return $value; } // End function. //usage simple pass a string to the function and return the data back to the same variable $sample = "<a href='#'>test</a>"; $sample = clean($sample); echo $sample;