嗨,我使用此代码读取和写入文件中的文本.
$d = fopen("chat.txt", "r");
$content=fread($d,filesize('chat.txt'));
$bn=explode('||',$content);
foreach($bn as $bn)
echo $bn.'<br>';
Run Code Online (Sandbox Code Playgroud)
和
$d = fopen("chat.txt", "a");
$c=$_GET['c'];
if($c=='') die();
fwrite($d,$c.'||');
fclose($d);
Run Code Online (Sandbox Code Playgroud)
但是= =只有= utf-8字符显示"?" 要么 "[]" .我的编码Utf-8没有BOM,我使用它
header('Content-type: text/html; charset=UTF-8');
Run Code Online (Sandbox Code Playgroud)
还有这个 :
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
Run Code Online (Sandbox Code Playgroud)
我在php.ini中的defult编码是utf-8但是还显示?.我在文件中看到chat.txt文件和字符,但是在文件中保存时和在页面中显示"?"时 而不是正确的.
嗨我有ckeditor和一个按钮保存cjeditor文本whith ajax.
<textarea id="editor1" name="editor1"></textarea>
<input type="button" name="send" id="send" value="Send" onclick="save()">
Run Code Online (Sandbox Code Playgroud)
我想要删除按钮,当按键输入保存文本whith ajax(运行保存功能)但按下输入ckeditor换行符.以及如何使用输入交换按钮?
<textarea id="editor1" name="editor1"></textarea>
if (enter press in any where web page ) do save();
Run Code Online (Sandbox Code Playgroud) 我在jQuery中有一个对话框,我想在文档加载时显示对话框.但我不想把代码放进去<body onload="showdialog();">.我想将javascript放在主div或footer div中,就像onload在body事件中一样.有什么办法吗?
<body onload="$('#dialog').slideDown('slow');">
<div id="dialog">Dialog</div>
<footer></footer>
</body>
Run Code Online (Sandbox Code Playgroud)
我要这个:
<body>
<div id="dialog">Dialog</div>
<script> show dialog code in load page </script>
<footer>
// or this place =>
<script> show dialog code in load page </script>
</footer>
</body>
Run Code Online (Sandbox Code Playgroud) 我有这个代码的div
样式
#input{background:url(../image/main.png)}
#input:hover {background:url(../image/hover.png)}
Run Code Online (Sandbox Code Playgroud)
HTML
<div id="input">input div </div>
<div id="input">input div 2</div>
<div id="input">input div 3</div>
<div id="input">input div 4</div>
Run Code Online (Sandbox Code Playgroud)
当页面加载main.png加载并显示但是当鼠标在div上第一个div黑色并且在2或3秒后hover.png显示.我的背景图片大小不是很大,但也许主机非常弱,无论如何加载两张图片第一次和悬停图片显示快?