Advertisement
lmohanarun

EdmundsSealed EdmundsSealed

Oct 19th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.08 KB | None | 0 0
  1. Website : www.mohanarun.com at the lower right corner, "Leave a message".
  2.  
  3. <!doctype html>
  4. <head>
  5. <title>Edmunds demo http://edmunds.mashery.com/io-docs</title>
  6. <link rel="import" href="statcounter-include.html">
  7. </head>
  8. <body>
  9. <h2>Data Source: edmunds.com json feed https://api.edmunds.com/api/vehicle/v2/makes?state=new&name=BMW&year=2014&view=basic&fmt=json&api_key=vmdbt389kmb46g2ub669jwjq
  10. </h2>
  11. <h3>Now displaying VEHICLE API returned data. State New, Name BMW, year 2014, view basic</h3>
  12. <table width=90% border=1><thead><tr><th>Name</th><th>NiceName</th></tr></thead><tbody>
  13. <?php
  14. $url = "https://api.edmunds.com/api/vehicle/v2/makes?state=new&year=2015&view=basic&fmt=json&api_key=vmdbt389kmb46g2ub669jwjq";
  15. if ($url) {
  16. $json = file_get_contents($url);
  17. $data = json_decode($json);
  18.  
  19. foreach ($data->makes as $result) {
  20. echo "<tr>";
  21. echo "<td>" . $result->name . "</td>";
  22. echo "<td>" . $result->niceName . "</td>";
  23. echo "</tr>";
  24. }
  25. ?>
  26. </tbody></table>
  27. <?
  28. }
  29. var_dump($data);
  30. ?>
  31. </body>
  32. </html>
  33.  
  34. http://mohanarun.com/edmundsdemo.php works!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement