Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function clean_utf8($s) {
- return iconv('UTF-8', 'UTF-8//IGNORE', $s);
- }
- function check_utf8($s) {
- return mb_check_encoding($s, 'UTF-8');
- }
- function clean_input(&$a) {
- if (isset($a) && is_array($a) && !empty($a))
- foreach ($a as $k => &$v)
- clean_input($v);
- elseif (is_string($a) && !mb_check_encoding($a, 'UTF-8'))
- $a = iconv('UTF-8', 'UTF-8//IGNORE', $a);
- return true;
- }
Add Comment
Please, Sign In to add comment