<?php function convert($message) { $message = stripslashes($message); $message = htmlspecialchars($message, ENT_QUOTES, "UTF-8"); // $message = utf8_encode($message); return $message; } function convert_array($vs) { $vars = array(); if(sizeof($vs)) { foreach($vs as $k => $v) { $vars[$k] = convert($v); } } return $vars; } ?>