Something
public php v1 · immutable<?php#filename counter$counter=1;#open a pipe with results from the find command$handle = popen("find foldername -name '*.jpg'", 'r');while(!feof($handle)) { $orig_filename = fgets($handle); $new_filename=sprintf("%05d.jpg",$counter); # rename shell_exec('mv "'.$orig_filename.'" "'.$new_filename.'"'); $counter++;}pclose($handle);?>