日期:2014-05-16 浏览次数:20644 次
$img = array
(
"./web/su.bdimg.com/static/superpage/css/../img/spis_9762e054.png",
"./web/su.bdimg.com/static/superpage/css/../img/baidu_fm_gif_72f357cc.gif",
"./web/su.bdimg.com/static/superpage/css/../img/guide_sprite_df6dde4a.png",
"./web/su.bdimg.com/static/superpage/css/../img/cite_sprite_121e6560.png",
"./web/su.bdimg.com/static/superpage/css/../img/hotnews_ac6c5b7e.png",
"./web/su.bdimg.com/static/superpage/css/../img/hotnews_ie_ca7d3ffd.png"
);
foreach($img as $v){
$a=dirname($v);
echo $a,'<br/>';
if(!file_exists($a) && mkdir($a,0777,true)){
echo $a.'<font color="green">路径创建成功</font><br/>';
}
}
@mkdir($a,0777,true) 这样也可以,但是楼上说的很对。