The MU forums have moved to WordPress.org

Parse error: syntax error, unexpected T_LNUMBER (2 posts)

  1. hhuskies
    Member
    Posted 16 years ago #

    Hello,

    I am getting a Parse Error saying there is an error on line 90 of formatting.php. Here is the code I am running. Is this correct?

    function seems_utf8($Str) { # by bmorel at ssi dot fr
    for ($i=0; $i<strlen($Str); $i++) {
    if (ord($Str[$i]) 0x80) continue; # 0bbbbbbb
    elseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb
    elseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb
    elseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb
    elseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb
    elseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b
    else return false; # Does not match any model
    for ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?
    if ((++$i == strlen($Str)) || ((ord($Str[$i]) & 0xC0) != 0x80))
    return false;
    }
    }
    return true;
    }

  2. PhoenixRises
    Member
    Posted 16 years ago #

    Hmm, that code looks familiar :S

    Check your first if statement for a start.

About this Topic

  • Started 16 years ago by hhuskies
  • Latest reply from PhoenixRises