0

我有一个与字符集问题有关的问题,但它有所不同,因为我没有任何土耳其字符问题。但是,如果我想它更高,那将是一个问题。

我的代码如下

//To Up title (Ş,I doesn't be upper)
$haberbaslik = strtoupper($haberbaslik);

//Explode title with space
$haberbaslik =  explode(" ",$haberbaslik);

for($i=0;$i<count($haberbaslik);$i++){
    // title which is exploded is in array
$list = str_split($haberbaslik[$i]);

for($j=0;$j<count($list);$j++){

    if($j==0){
        $text .= $list[$j];
        if($list[$j]=="'"){
                //It is problematic one. When it works, if char is Ş or I it give ? 
                $text .= mb_strtoupper($list[$j+1],'UTF-8');

                $text .= $list[$j+1];


            $list[$j+1] = "";
        }
        if($list[$j]=='"'){
                     //It is problematic one. When it works, if char is Ş or I it give ? 
                $text .= mb_strtoupper($list[$j+1],'UTF-8');

                $list[$j+1] = "";
        }
    }else{
        $text .= strtolower($list[$j]);
    }

}
$text .= " ";
}

错误如下

预期:“Şike” 显示:“?�ike”

预期:“伊斯坦布尔” 显示:“伊斯坦布尔”

4

0 回答 0