php中在文件倒数140个字节的地方插入一个字符串,文件指针却一直在文件末尾
黄舟
黄舟 2017-04-10 15:36:08
0
0
690
<?php
$string="haha";
$target='<input type="button" value="submit" id="submitform">';
$handle = fopen("D:/wamp/www/liuyanban.html","a");
 fseek($handle, -140,SEEK_END);
 fwrite($handle, "ok");
 fclose($handle);
?>

我想问,为什么我已经用fseek把文件指针改到倒数140个字节的地方,可是写入的时候,还是写在文件末尾的,如果这么做是错的,为什么?合理的思路是什么?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

répondre à tous(0)
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!