hackerman Posted March 8, 2007 Report Share Posted March 8, 2007 Man ir direktorija ar vairākiem failiem un vajag reneimot visus failus piem. fails-123 fails-1234 utt vajag pārvērst par nosaukums_fails-123 nosaukums_fails-1234 Link to comment Share on other sites More sharing options...
Stopp Posted March 8, 2007 Report Share Posted March 8, 2007 Kā angliski ir 'pārsaukt'? ;) Tāpat ir arī PHP funkcija. Par opendir, readdir funkcijām droši vien jau zini. Link to comment Share on other sites More sharing options...
hackerman Posted March 8, 2007 Author Report Share Posted March 8, 2007 Labi, tiku tik tāl, ka ja uzraksta echo "$file <br>"; Parādās visi faili... Īsti nemāku ar to rename fciju. Link to comment Share on other sites More sharing options...
andrisp Posted March 8, 2007 Report Share Posted March 8, 2007 rename($file, 'jaunais_nosaukums'); Link to comment Share on other sites More sharing options...
Val Posted March 8, 2007 Report Share Posted March 8, 2007 Tam jau domāts manuālis: http://lv.php.net/rename Link to comment Share on other sites More sharing options...
Stopp Posted March 8, 2007 Report Share Posted March 8, 2007 while(readdir) { rename($file, 'jauns_nosaukums'); } Tik grūti? Ja gribi beigās paturēt vēl veco nosaukumu, tad 'jauns_nosaukums-'.$file Link to comment Share on other sites More sharing options...
Recommended Posts