$handle = fopen('test.html','w'); if(fwrite($handle,'hello world.2018')>0){ fclose($handle); echo "写入成功"; }else{ echo "写入失败,请稍后再试"; }