<?php
//新建目录
mkdir("/path/to/my/dir", 0700); //0700表示权限最大
//删除目录
rmdir("/path/to/my/dir");
//遍历目录
$p =dir(/etc/php5);
echo "handler:".$p->handler;
while(false!=$entry=$p->read()){
echo $entry."/n" ;
}
$p->close();
//输出文件内容
$handle=@fopen("/tmp/file.txt","r"); //fopen也可以打开一个url
if($handle){
while(!feof($handler)){
echo fgets($handler,4096);
}
}
//二进制形式打开
$filename="/tmp/file.txt";
$handle=@fopen($filename,"b");?>
if($handler){
$content=fread($handler,filesize($filename));
fclose($handler);
echo $content;
}
//获得url内容
$html=file_get_contents(http://www.baidu.com);
echo $html;