/ Published in: PHP

Need a function to clean your _POST array before inserting into a database? Just pass $_POST to this function.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function clean_array_for_post($post) { foreach($post as $key => $value) { // stripslashes, we don't want to rely on magic quotes } // quote if not a number } } return $post; }
Comments
