<?php
$filename = '/data/webroot/usercode/code/test2.txt';
file_put_contents($filename,'hello world!');
//echo file_get_contents($filename);
//$fp=fopen($filename,'w');
//fwrite($fp,'hello world!');
//fclose($fp);
//$fp=fopen($filename,'r');
//echo fread($fp,15);
//fclose($fp);
$filename = '/data/webroot/usercode/code/test2.txt';
file_put_contents($filename,'hello world!');
//echo file_get_contents($filename);
//$fp=fopen($filename,'w');
//fwrite($fp,'hello world!');
//fclose($fp);
//$fp=fopen($filename,'r');
//echo fread($fp,15);
//fclose($fp);
2015-06-25
<?php
$filename = '/data/webroot/usercode/code/resource/test.txt';
//编写代码读取$filename的文件内容
$fp=fopen('/data/webroot/usercode/code/resource/test.txt','rb');
echo fread($fp,1024);
fclose($fp);
$filename = '/data/webroot/usercode/code/resource/test.txt';
//编写代码读取$filename的文件内容
$fp=fopen('/data/webroot/usercode/code/resource/test.txt','rb');
echo fread($fp,1024);
fclose($fp);
2015-06-24
<?php
$fruit=array(‘苹果’,‘香蕉’,'菠萝‘)
for($i=0,$i<3,$i++){
echo ’<br>数组第'$i.’值是:’.$fruit[$i];
}
$fruit=array(‘苹果’,‘香蕉’,'菠萝‘)
for($i=0,$i<3,$i++){
echo ’<br>数组第'$i.’值是:’.$fruit[$i];
}
2015-06-24