Advertisement
irokemr

Noticias Fornite JSoN

Apr 27th, 2020
12,185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.70 KB | None | 0 0
  1. <?php
  2. header('Content-type: application/json');?>{"br":[<?php
  3. $response = json_decode(file_get_contents('https://fortnitecontent-website-prod07.ol.epicgames.com/content/api/pages/fortnite-game?lang=es'), true);
  4. /*var_dump($response);*/
  5.  
  6.      $count = count($response['battleroyalenews']['news']['motds']);
  7.        
  8.     $else = false;
  9.  
  10. $data = $response['battleroyalenews']['news']['motds'];
  11.  
  12.  for($i = 0; $i < $count; $i++) {
  13.  $signature = current($data);
  14.  
  15.  
  16.  echo '{"image":"';
  17.  echo $data[$i]['image'] . '","title":"';
  18.  echo $data[$i]['title'] . '","body":"';
  19.  echo $data[$i]['body'] . '"},';
  20.  
  21.     next($response);
  22.      
  23. }
  24.  
  25. // Function to convert array into JSON
  26.  
  27.  
  28.  
  29. echo  '{}]}';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement