Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dir="audio/mp3/";
- $dir1=opendir($dir);
- $mp3 = Array();
- while( $res=readdir($dir1) ){
- $tipo=explode('.',$res);
- if ( $tipo[1]=='mp3' || $tipo[1]=='MP3' ){
- $mp3[] = 'audio/mp3/'.$res;
- }
- }
- shuffle($mp3);
- echo implode( '|', array_slice($mp3, 0, 1));
- ?>
- <audio controls autoplay id="myaudio">
- <source src="<?php echo implode( '|', array_slice($mp3, 0, 1)); ?>" type="audio/mp3">
- Your browse</audio>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement