我有一个问题:我尝试用php替换特殊字符但不是所有字符都被替换,我的代码是:
public function generateTitlePage($company)
{
$this->load->library('dompdf_gen');
$dompdf = new DOMPDF();
$search = array('%27', '%20', '%C3%A2', '%C3%AE', '%C4%83');
$replace = array('', ' ', 'â', 'î', 'ă');
$company = str_replace($search, $replace, $company);
$html = '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="margin-top:20px;text-align: center;font-weight: bold">
Company:'.$company.'</div>
</body>
</html>';
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("welcome.pdf");
}
在这个例子中,只更换'â'和'î'而不是'ă'出现'?',问题在哪里,Plsease帮助我们