我不能得到马拉雅拉姆字体而搜索一些马拉雅拉姆语单词,并搜索马拉雅拉姆语单词,如കാര്യങ്ങള്,它会得到一个代码,如%E0%B4%95%E0%B4%BE%E0%B4%B0%E0%B5%8D%E0%B4%AF%E0%B4%99%E0%B5%8D%E0%B4%99%E0%B4%B3%E0%B5%8D%E2%80%8D。我不知道服务器端发生了什么。我正在使用codeigniter。我的HTML是
<input name="search" id="search" type="text" class="dh_home_05" placeholder="Search"/>
<div style="float:right;"><img src="<?=base_url()?>images/new_search_btn.jpg" class="wholesearch"></div>我的Javascript代码是
$(document).ready(function() {
$('#search').keypress(function (e) {
var key = e.which;
if(key == 13) { // the enter key code
$('.wholesearch').click();
return false;
}
});
$('.wholesearch').click(function(){
if($('#search').val() != ''){
$str = $('#search').val();
$str = $str.replace(/^\s+|\s+$/g, ''); // trim
//$str = $str.toLowerCase();
$from = "����������������������/_,:;";
$to = "aaaaeeeeiiiioooouuuunc------";
for ($i = 0, $l = $from.length ; $i < $l; $i++) {
$str = $str.replace(new RegExp($from.charAt($i), 'g'), $to.charAt($i));
}
//$str = $str.replace(/[^a-z0-9 -]/g, ' ') // remove invalid chars
$str = $str.replace(/\s+/g, '-') // collapse whitespace and replace by -
.replace(/-+/g, '-'); // collapse dashes
window.location = "<?=base_url();?>search/common/"+$str;
}
return false;
});
});谁能教我如何在php中使用马拉雅拉姆字体?我的php函数是:
public function common($wd){
print_r($wd);die;
}我打印了这个$wd,但结果是:
%E0%B4%95%E0%B4%BE%E0%B4%B0%E0%B5%8D%E0%B4%AF%E0%B4%99%E0%B5%8D%E0%B4%99%E0%B4%B3%E0%B5%8D%E2%80%8D发布于 2017-05-26 19:20:09
在页眉部分添加此样式表
<link href="https://fonts.googleapis.com/css?family=Baloo+Chettan" rel="stylesheet">在样式表中
.malayalamfont{font-family: 'Baloo Chettan', cursive;font-size: 15px;}在视图页面(html部分)中
<p class="malayalamfont">your text</p>https://stackoverflow.com/questions/44130405
复制相似问题