示例:
以下字符串在json.js文件中定义。
var test = "One complimentary entrée with the purchase of an entrée.";
它由包含在index.html文件中
<script type="text/JavaScript" src="./json.js"></script>
当字符串显示在UI中时,它显示为
"One complimentary entr�e with the purchase of an entr�e."
但是如果字符串
我试图将HTML保存到一个.html文件中,
这是行之有效的:
$html_file = "output.html";
$output_string="string with characters like ã or ì";
$fileHandle = fopen($html_file, 'w') or die("file could not be accessed/created");
fwrite($fileHandle, $output_string);
fclose($fileHandle);
当我检查output.htm