Skip to content

Instantly share code, notes, and snippets.

@postphotos
Created August 24, 2013 22:00
Show Gist options
  • Save postphotos/6330651 to your computer and use it in GitHub Desktop.
Save postphotos/6330651 to your computer and use it in GitHub Desktop.
Magic unicorn on loop abilities
<?php
$min=1; $max=14; //the random parameters
?>
<object width="746" height="413"><param name="movie" value="http://www.youtube.com/p/CAAA1242CA3E37B4?version=3&hl=es_ES&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<?php
//in index the script randomize the number between $min $max
echo "<iframe src=\"http://www.youtube.com/embed/videoseries?list=PL2AC71FC1DAB7F216&autoplay=1&index=".rand($min,$max)."\"
width=\"100%\" height=\"500\" frameborder=\"0\"></iframe>
";
?>
</object>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment