<?
$list = glob( "*.dat" );
if ( is_array( $list ) ) {
 shuffle( $list );
 foreach( $list as filename ) {
  var_dump( $filename );
 }
}
?>