PHP Fix errors if mbstring is not loaded

by in 0

My script work good on shared hosting until hosting disable mbstring

Now my script can't run.
Many functions MB_  mb_strrpos mb_get_info .... get undefined errors.






function mb_detect_order($encoding_list = '')
function mb_language($language='')
function mb_internal_encoding($encoding = '')
function mb_get_info($type = 'all')
function mb_substitute_character($subchar='')
function mb_convert_encoding( $str, $to_encoding, $from_encoding = '')
function _sjistoeuc(&$str)
function _euctosjis(&$str)
function _sjistojis(&$str)
function _sub_jtosj($match)
function _jistosjis(&$str)
function _ucs2utf8($uni)
function _sjistoutf8(&$str)
function _utf8ucs2($st)
function _utf8tosjis(&$str)
function _euctoutf8(&$str)
function _utf8toeuc(&$str)
function _utf8toutf16(&$str)
function _utf16toutf8(&$str)
function sub_zenhan_EUC(&$str, $match) {
function sub_hanzen_EUC(&$str, $match) {
function alpha_zenhan_EUC(&$str) {
function alpha_hanzen_EUC(&$str) {
function num_zenhan_EUC(&$str) {
function num_hanzen_EUC(&$str) {
function alphanum_zenhan_EUC(&$str) {
function alphanum_hanzen_EUC(&$str) {
function space_zenhan_EUC(&$str) {
function space_hanzen_EUC(&$str) {
function katakana_zenhan_EUC(&$str) {
function hiragana_zenhan_EUC(&$str) {
function katakana_hanzen1_EUC(&$str) { //‘÷“_‚Ì“‡‚ð‚·‚é•û
function hiragana_hanzen1_EUC(&$str) { //‘÷“_‚Ì“‡‚ð‚·‚é•û
function katakana_hanzen2_EUC(&$str) { //‘÷“_‚Ì“‡‚ð‚µ‚È‚¢•û
function hiragana_hanzen2_EUC(&$str) { //‘÷“_‚Ì“‡‚ð‚µ‚È‚¢•û
function katakana_hiragana_EUC(&$str) {
function hiragana_katakana_EUC(&$str) {
function mb_convert_kana( $str, $option='KV', $encoding = '')
function mb_send_mail($to, $subject, $message , $additional_headers='', $additional_parameter='')
function _check_encoding($str, $encoding_number)
function mb_detect_encoding( $str , $encoding_list = '')
function mb_strlen ( $str , $encoding='')
function mb_strwidth( $str, $encoding='')
function mb_strimwidth( $str, $start, $width, $trimmarker , $encoding = '')
function mb_substr ( $str, $start , $length='notnumber' , $encoding='')
function _sub_strcut($arr, $start, $length) {
function mb_strcut ( $str, $start , $length=0 , $encoding = '')
function _sub_strrpos($ar_haystack, $ar_needle)
function mb_strrpos ( $haystack, $needle , $encoding = '')
function _sub_strpos($ar_haystack, $ar_needle, $offset)
function mb_strpos ( $haystack, $needle , $offset = 0, $encoding = '')
function _sub_substr_count($ar_haystack, $ar_needle)
function mb_substr_count($haystack, $needle , $encoding = '')
function mb_convert_variables($to_encoding, $from_encoding, $s1, $s2='',$s3='',$s4='',$s5='',$s6='',$s7='', $s8='',$s9='', $s10='')
function mb_convert_variables($to_encoding, $from_encoding, &$arr)
function mb_preferred_mime_name ($encoding)
function mb_decode_mimeheader($str)
function _sub_qponechar($str, &$len)
function _sub_quoted_printable_encode($str, $encoding, $maxline, $linefeed)
function _sub_encode_base64($str, $encoding, $maxline , $linefeed)
function mb_encode_mimeheader( $str, $encoding = "ISO-2022-JP", $transfer_encoding = "B", $linefeed = "\r\n")
function mb_http_input($type = '')
function mb_http_output($encoding = '')
function mb_output_handler ( $buffer, $status='')
function mb_encode_numericentity($str, $convmap, $encoding="")
function mb_decode_numericentity ($str, $convmap, $encoding="")
function mb_strtoupper($str, $encoding='')
function mb_strtolower($str, $encoding='')
function mb_convert_case($str, $case, $encoding='')
function _print_str($str)
So we have to include mb-emulator php in very first of your script

Download this:
MB emulator

Then include this code:

if (! extension_loaded('mbstring')) {
  require_once('mb-emulator.php');
}
It's all fixed

Leave a Reply