fork download
  1. <?php
  2.  
  3. $videos = [
  4. '02' => [
  5. 'video' => 'https://w...content-available-to-author-only...e.com/watch?v=u4alGiomYP4',
  6. 'tag' => 'tutorial1',
  7. ],
  8. '09' => [
  9. 'video' => 'https://w...content-available-to-author-only...e.com/watch?v=u4alGiomYP4',
  10. 'tag' => 'tutorial2',
  11. ],
  12. '16' => [
  13. 'video' => 'https://w...content-available-to-author-only...e.com/watch?v=u4alGiomYP4',
  14. 'tag' => 'tutorial3',
  15. ],
  16. '23' => [
  17. 'video' => 'https://w...content-available-to-author-only...e.com/watch?v=u4alGiomYP4',
  18. 'tag' => 'tutorial4',
  19. ],
  20. '30' => [
  21. 'video' => 'https://w...content-available-to-author-only...e.com/watch?v=u4alGiomYP4',
  22. 'tag' => 'tutorial5',
  23. ],
  24. ];
  25. $i = 0;
  26. $day_today = date('j');
  27. $current_vid = array_values($videos)[0]; // definir o primeiro video como pre-definido
  28.  
  29. while($i <= $day_today) {
  30. if(isset($videos[$i])) {
  31. $current_vid = $videos[$i];
  32. }
  33. $i += 1;
  34. }
  35. echo $current_vid['video']. "\n";
  36. echo $current_vid['tag'];
Success #stdin #stdout 0.02s 23944KB
stdin
Standard input is empty
stdout
https://w...content-available-to-author-only...e.com/watch?v=u4alGiomYP4
tutorial4