phpMoot
phpMoot > PHP - Examples > PHP – Clean String for DB Entry
Author: phpMoot November 19, 2013
PHP - Examples
This PHP function helps you to clean a string while save into database.
Code Example:
<?php function clean_for_db($data) { $entry = trim($data); $entry = strip_tags($entry); $entry = mysql_real_escape_string($entry); return $entry; } ?>
← Previous post
Next post →