Advertisement
lmohanarun

EdmundsSealed EdmundsSealed

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