Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4086268
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:42:08+00:00 2026-05-20T18:42:08+00:00

How to detect all music on a harddrive, then copy it to a folder

  • 0

How to detect all music on a harddrive, then copy it to a folder in PHP?
I have 3 folder named music1, music2, music3 I want to get all the music from those folders and move it to a one folder named Music. Is this possible in php?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:42:09+00:00Added an answer on May 20, 2026 at 6:42 pm
    function moveMyMusic($path){
        if ($handle = opendir($path)) {
            while (false !== ($file = readdir($handle))) {
                if($file != '.' && $file != '..'){
                @rename($path . $file, '/mynewmusic/'.$file)
            }
        }
        closedir($handle);
    }
    moveMyMusic('/music1/');
    moveMyMusic('/music2/');
    moveMyMusic('/music3/');
    

    It doesn’t look for music files only and will not overwrite existing files, but keep them in the original directory.

    Quite frankly, there are easier ways to do that, like this one using bash: Unix shell file copy flattening folder structure

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 2-d array for which I want to detect all locally maximal
Given a web URL, I want to detect all the links in a WEBSITE
I'm wanting to detect all objects(classes) defined in a php file (example: flavors.php). The
I am using WPF WebBrowser control. How can I detect all outgoing Http GET
I would like to detect all time like strings in a webpage, and then
How to detect Firefox in JavaScript? I want to detect all versions of Firefox.
Possible Duplicate: Detect all changes to a <input type=text> (immediately) using JQuery I have
I'd like to detect all plain-text NDEF-NFC-Tags that have a certain prefix (e.g. mytagprefix1234567890
How can I detect all WiFi networks availables using Delphi? (source: filebuzz.com )
With the following code i detect all squares in a gray scale image: for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.