0

mytxt.txt 中的文本示例

Budu Bawa Pathana,බුදු බව පතනා,budu-bawa-pathana 
Budu Piya Mage,බුදු පියා මගේ,budu-piya-mage
Dewathi Deva Raja,දෙවැති දේව රාජා,dewathi-deva-raja 
Domnase Mulawe,දොම්නසේ මුලාවේ,domnase-mulawe

脚本 :

$lines = file('mytxt.txt');
$count = count($lines);

// Two dimensional array
$datax = array();

$i = 0;

foreach($lines as $value) {

    if($i!=0):
        list($id,$english,$sinhala,$html) = explode(",", $value);
        $datax[$i]['id'] = $id;
        $datax[$i]['eng'] = $english;
        $datax[$i]['sin'] =$sinhala;
        $datax[$i]['html'] = $html;
    endif;
    $i++;
}
$data['impData'] = $datax;

当我运行脚本时。僧伽罗语 Unicode 文本显示为黑框。我有什么解决方案可以将结果打印为 Unicode 文本吗?HTML 标头设置为 utf-8

4

0 回答 0