Comment concaténer plusieurs fichiers?

Utilisateur anonyme -  
Ozimandias Messages postés 528 Statut Membre -
Bonjour,voici mon code:
$path = 'sound\A.mp3';
$path1 = 'sound\B.mp3';
$mp3 = new mp3($path);
$mp3->striptags();
$mp3_1 = new mp3($path1);
$mp3->mergeBehind($mp3_1);
$mp3->striptags();
$newpath = 'sound\path.mp3';
$mp3->setIdv3_2('***','***');
$mp3->save($newpath);

dans ce code j'ai deux variables $path et $path1
mon problème c'est comment placer une boucle si j'ai plusieurs fichiers à concaténer.
Merci

1 réponse

Ozimandias Messages postés 528 Statut Membre 46
 
Modifie ta variable $path. Transforme la en tableau: $path[0] = 'sound\A.mp3'; $path[1] = 'sound\B.mp3'; ETC...

après tu parcours ton tableau avec une boucle:

foreach ($path as $recup){
// ici tu travaille avec la variable $recup
}

lien vers foreach manuel: http://www.manuelphp.com/php/control-structures.foreach.php
0