please. mp3 Data delay Batch Rename instances

Source: Internet
Author: User
Tags glob shuffle
Request. mp3 File delay Batch Rename instance
The website Music directory has 10 irregular file names. mp3 music files, I want them to automatically rename, rename the rule to use 1~10 random number, and every 5 minutes again with the above rules renamed, preferably in the background automatically run, how to do?
Just contact PHP, there are a lot of questions do not understand, I hope you can help a lot later.

------Solution--------------------
Explore

Simple handling
PHP Code

$shuffle _num = range (1, 10);
Shuffle ($shuffle _num);
foreach (Glob (' Tmp/*.mp3 ') as $key = = $filename) {
$newname = ' tmp/'. $shuffle _num[$key]. MP3 ';
Rename ($filename, $newname);
......

------Solution--------------------
Explore

Reference:

Simple handling
PHP Code

$shuffle _num = range (1, 10);
Shuffle ($shuffle _num);
foreach (Glob (' Tmp/*.mp3 ') as $key = = $filename) {
$newname = ' tmp/'. $shuffle _num[$key]. MP3 ';
Rename ($f ...
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.