您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php中批量修改文件后缀名的函数代码

2025/11/24 12:42:13发布11次查看
代码如下:
<?php function foreachdir($path){ $handle=opendir($path); if($handle){ while (false !== ($file = readdir($handle))) { if($file!="." && $file!='..'){ if(is_dir($path.$file)){ echo $path.$file."<br/>"; foreachdir($path.$file); }else{ echo "--".$path."/".$file."<br/>"; $ext = strripos($file,'.'); $aaa = substr($file,0,$ext); rename($path.'/'.$file,$path.'/'.$aaa.'.jpg'); // die(); } } } return false; } } foreachdir('d:\xampp\htdocs\tnf2');
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product