文件读取 php修改服务器上的文件代码
php修改服务器上的文件代码 [代码片段(9行)]
<?php // update.php
$fh = fopen("testfile.txt", 'r+') or die("Failed to open file");
$text = fgets($fh);
fseek($fh, 0, SEEK_END);
fwrite($fh, "$text") or die("Could not write to file");
fclose($fh);
echo "File 'testfile.txt' successfully updated";
?>
精彩图集
精彩文章






