All pastes #608345 Raw Edit

Something

public text v1 · immutable
·published 2007-07-08 07:06 UTC
rendered paste body
foreach ($files as $file) {
    if (in_array($file[count($file)-1], $musicTypes)) {
        rename("/home/m/".join('.', $file), "/home/m/public_html/Music/".join('.', $file));
    } elseif (in_array($file[count($file)-1], $videoTypes)) {
        rename("/home/m/".join('.', $file), "/home/m/public_html/Video/".join('.', $file));
    } elseif ((in_array($file[count($file)-1], $imageTypes)) {
        rename("/home/m/".join('.', $file), "/home/m/public_html/Images/".join('.', $file));
    } elseif (in_array($file[count($file)-1], $docTypes)) {
        rename("/home/m/".join('.', $file), "/home/m/public_html/Docs/".join('.', $file));
    }
}