<?php if(file_exists('welcome.txt')) { $file = fopen('welcome.txt','r'); //文件打开,只读模式 } else { die('文件不存在.'); }