最赞回答 / jason300614
$filename = '/data/webroot/usercode/resource/test.txt';//编写代码读取$filename的文件内容$str = 'this is a test file.';$contents = file_put_contents($filename,$str);$newStr = file_get_contents($filename);echo $newStr;
2014-11-25
$filename = '/data/webroot/usercode/resource/test.txt';
$size=filesize($filename);
echo $size;
$size=filesize($filename);
echo $size;
2014-11-24
file_put_contents($filename,'为什么不存在呢');
if(is_file($filename)){
echo file_get_contents($filename);
}else{
echo '文件不存在';
}
if(is_file($filename)){
echo file_get_contents($filename);
}else{
echo '文件不存在';
}
2014-11-24
$content1=file_put_contents($filename,'this is a test file');
2014-11-24