A: 

Each time through the loop, you are reassigning $mp3dataArray. You probably want to append to the array rather than just replace it each time.

James McLeod
+1  A: 

try this

<?php
$mp3testarray = array();
foreach ($mp3data as $key => $val) {
    $mp3datafile = $val;
    $m = new mp3file($mp3datafile);
    $mp3dataArray = $m->get_metadata();
    $mp3testarray[] = array($mp3dataArray);
}
// check $mp3testarray[] 
print_r($mp3testarray);

?>
Gabriel Sosa
Thank you so much, it works a treat. As soon as I can rate it up, I will! I'd have thanked you sooner but "notify of reply by email" doesn't appear to be working.
talkingnews
A: 

try this code:

<?php

$mp3dataArray = array();                         //get array ready for each file
foreach ($mp3data as $key => $val) {             //for each file in dir
    $m = new mp3file($val);                      //get current file's mp3 info
    $mp3dataArray[] = array($m->get_metadata()); //store current mp3 info in next array element
}
var_dump($mp3dataArray);                         //display all of the array's contents

?>
KM