Guest User

array_rand

a guest
Mar 23rd, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1.         <?php
  2.         $files = glob("http://domain.com/dir/*.mp3");
  3.         $random = array_rand($files, 2);
  4.         $files = $files[$random[0]];
  5.         $files = $files[$random[1]];
  6.         ?>
  7.         <!-- <audio controls="controls">
  8.         <source src="<?php echo $fname1; ?>" type="audio/mpeg">
  9.         </audio> -->
  10.         <object>
  11.             <param name="autostart" value="true">
  12.             <param name="src" value="http://link.com/">
  13.             <param name="autoplay" value="true">
  14.             <param name="controller" value="true">
  15.             <embed src="<?php echo $files; ?>" volume="30" hidden="true" controller="true" autoplay="true" autostart="true" type="audio/wav" loop="false"/>
  16.         </object>
Advertisement
Add Comment
Please, Sign In to add comment