时间:2021-07-01 10:21:17 帮助过:42人阅读
$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,'
';
if(!file_exists($a) && mkdir($a,0777,true)){
echo $a.'路径创建成功
';
}
}
@mkdir($a,0777,true) 这样也可以,但是楼上说的很对。