I am currently writing a PHP function but when the complete script is executed I am getting an error:
Error:
Call to undefined function mb_convert_encoding()
My function:
function cleanData(&$str)
{
if($str == 't') $str = 'TRUE';
if($str == 'f') $str = 'FALSE';
if(preg_match("/^0/", $str) || preg_match("/^\+?\d{8,}$/", $str) || preg_match("/^\d{4}.\d{1,2}.\d{1,2}/", $str)) {
$str = "'$str";
}
if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"';
$str = mb_convert_encoding($str, 'ISO-8859-1','utf-8');
}
Can anyone see where I am going wrong. Many thanks in advance for your time.
Cheers