phpDesigner 8 - Does not support function mb_substr()

162 views Asked by At

The code below runs in a browser but not in the development environment of phpDesigner 8:

public function charCodeAt($str, $num) { 
   return $this->utf8_ord($this->utf8_charAt($str, $num)); 
}

public function utf8_ord($ch) {
   $len = strlen($ch);
   if($len <= 0) return false;
   $h = ord($ch{0});
   if ($h <= 0x7F) return $h;
   if ($h < 0xC2) return false;
   if ($h <= 0xDF && $len>1) return ($h & 0x1F) <<  6 | (ord($ch{1}) & 0x3F);
   if ($h <= 0xEF && $len>2) return ($h & 0x0F) << 12 | (ord($ch{1}) & 0x3F) << 6 | (ord($ch{2}) & 0x3F);
   if ($h <= 0xF4 && $len>3) return ($h & 0x0F) << 18 | (ord($ch{1}) & 0x3F) << 12 | (ord($ch{2}) & 0x3F) << 6 | (ord($ch{3}) & 0x3F);
   return false;
}

public function utf8_charAt($str, $num) { 
   return mb_substr($str, $num, 1, 'UTF-8'); 
}

I get the error message: "Fatal error - Call to undefined function mb_substr()"

Can anyone suggest how to get mb_substr() to work? When I installed phpDesigner 8 I don't recall seeing an option to include additional libraries of functions.

I have tried contacting the company but they have not provided a solution.

Thanks!

0

There are 0 answers