xx - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of xx.php

  1. <?php
  2.  
  3. $list = [
  4.         "A Few Good Men",
  5.         "ATL",
  6.         "Action",
  7.         "All The King's Men",
  8.         "Anthropoid",
  9.         "Ava",
  10.         "Avengers Age of Ultron",
  11.         "Avengers End Game",
  12.         "Avengers Infinity War",
  13.         "Batman V Superman Dawn Of Justice",
  14.         "Birds Of Prey And The Fantabulous Emancipation Of One Harley Quinn",
  15.         "Black Mass",
  16.         "Booty Call",
  17.         "Capone",
  18.         "Captain America - The First Avenger",
  19.         "Captain America The Winter Soldier",
  20.         "Casualties of War",
  21.         "Child's Play",
  22.         "Dances with Wolves",
  23.         "Defiance",
  24.         "Den Of Thieves",
  25.         "Downfall",
  26.         "Drama&Family",
  27.         "Edge of Tomorrow",
  28.         "Eye In The Sky",
  29.         "Fantastic.Beasts.The.Secrets.of.Dumbledore.2022.1080p.HC.WEBRip.1600MB.DD2.0.x264-GalaxyRG%5bTGx%5d",
  30.         "Forrest Gump",
  31.         "Fracture",
  32.         "Fury",
  33.         "Geostorm",
  34.         "Ghost",
  35.         "Gold",
  36.         "Gone Girl",
  37.         "Henry VIII",
  38.         "History",
  39.         "Hitmain",
  40.         "Iron Man",
  41.         "Iron Man 2",
  42.         "Iron Man 3",
  43.         "James Bond Quantum of Solace",
  44.         "King Arthur",
  45.         "Kingdom of Heaven (2005) Directors Cut",
  46.         "Law Abiding Citizen",
  47.         "Machine Gun Preacher",
  48.         "Mary Queen Of Scots",
  49.         "Match Point",
  50.         "Muhammad The Messenger of God",
  51.         "Mulan (2020)",
  52.         "NUR3MB3RG",
  53.         "Notorious",
  54.         "Pearl Harbor",
  55.         "Pirates Of The Caribbean - Dead Men Tell No Tales",
  56.         "Pirates of the Caribbean - At Worlds End",
  57.         "Pirates of the Caribbean - Curse of the Black Pearl",
  58.         "Pirates of the Caribbean - Dead Man's Chest",
  59.         "Pirates of the Caribbean - On Stranger Tides",
  60.         "Raya and the Last Dragon",
  61.         "Schindlers List",
  62.         "Shadow in the Cloud",
  63.         "Six Minutes to Midnight",
  64.         "Skyfall",
  65.         "Spectre",
  66.         "Taken",
  67.         "The 92nd Annual Academy Awards",
  68.         "The Avengers",
  69.         "The Brothers Grimm",
  70.         "The Expendables 3",
  71.         "The Godfather",
  72.         "The Godfather Part 2",
  73.         "The Godfather Part 3",
  74.         "The Gods Must Be Crazy",
  75.         "The Incredible Hulk",
  76.         "The Iron Lady",
  77.         "The Lord of the Rings The Fellowship of the Ring",
  78.         "The Matrix 4 Resurrections",
  79.         "The Old Guard",
  80.         "The Passion of the Christ",
  81.         "The Secret Garden",
  82.         "The Shawshank Redemption",
  83.         "The Tudors",
  84.         "Thor The Dark World",
  85.         "Transcendence",
  86.         "Transformers The Last Knight",
  87.         "Uncharted",
  88.         "Vikings",
  89.         "Walk the Line EXTENDED",
  90.         "War of the Worlds",
  91.         "We Were Soldiers",
  92.         "Willow",
  93.         "Wonder Woman 1984",
  94.         "gucci"
  95. ];
  96.  
  97.  
  98. $json = (array) ["Movies" => []];
  99.  
  100. foreach ($list as $item) {
  101.  
  102.         $filename= "http://45.200.133.5:8089/".$item."/movie.mp4";
  103.         $file_headers = get_headers($filename);
  104.  
  105.         $movie = [
  106.         "title"   => $item,
  107.         "image"   => "http://45.200.133.5:8089/".$item."/poster.jpg",
  108.         "stream"  => "http://45.200.133.5:8089/".$item."/movie.mp4",
  109.         "source"  => "direct",
  110.         "exist"  => $file_headers[0],
  111.         "article" => [["figure"=> "http://45.200.133.5:8089/".$item."/poster.jpg", "paragraph" => $item]]
  112.     ];
  113.         array_push($json["Movies"], $movie);
  114. }
  115.  
  116. ksort($json);
  117.  
  118. $json   = json_encode($json);
  119. //$manual = file_get_contents("apps/movies.json");
  120.  
  121. //if (strcmp($json, $manual) != 0) file_put_contents('apps/movies.json', $json);
  122.  
  123.  
  124. header('Content-Type: application/json; charset=utf-8');
  125. print($json);
File Description
  • xx
  • PHP Code
  • 26 Dec-2022
  • 2.9 Kb
You can Share it: