<pre>
<?php

$dirpath = 'data/cutscenes/mfb';


$dir = new DirectoryIterator($dirpath);
foreach ($dir as $fileinfo) {
    if (!$fileinfo->isDot()) {
		
		$filename = $fileinfo->getFilename();
		$filename = preg_replace('/\\.[^.\\s]{3,4}$/', '', $filename);
		
		?>	
{ // <?php echo $filename; ?>

    name: "<?php echo  $filename; ?>",
    type: "image",
    src: "data/cutscenes/mfb/<?php echo $filename; ?>.png"
},
		<?php
       
    }
}

?>