Function: Clean string for DB entry

/ Published in: PHP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. function clean_for_db($data) {
  2. $entry = trim($data);
  3. $entry = strip_tags($entry);
  4. $entry = mysql_real_escape_string($entry);
  5. return $entry;
  6. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.