我有一些会自动生成字符串的代码,但有些特殊字符显示如下:�
代码:
header("Content-type: text/html; charset=utf-8");
function RandomString($length = 10){
$chars ='0123456789abcdefghijklmnopqrstuvwxyzåäöABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ!#¤%&()=?@£$€{}[]+';
$randString = '';
for($i = 0; $i < $length; $i++){
$randString .= $chars[rand(0, 88)];
}
echo $randString;
return $randString;
}