fork download
  1. <?php
  2.  
  3. // your code goes here
  4. $datas = Array(
  5. 0 => Array(
  6. 'trends' => Array (
  7. 0 => Array
  8. (
  9. 'name' => '#Allah_In_Quran',
  10. 'url' => 'http://t...content-available-to-author-only...r.com/search?q=%23Allah_In_Quran',
  11. 'promoted_content' => '',
  12. 'query' => '%23Allah_In_Quran',
  13. 'tweet_volume' => 216174
  14. ),
  15. 1 => Array
  16. (
  17. 'name' => 'Last Prophet Saint Rampal Ji',
  18. 'url' => 'http://t...content-available-to-author-only...r.com/search?q=%22Last+Prophet+Saint+Rampal+Ji%22',
  19. 'promoted_content' => '',
  20. 'query' => '%22Last+Prophet+Saint+Rampal+Ji%22',
  21. 'tweet_volume' => 161376
  22. )
  23. ),
  24.  
  25. as_of => '2021-03-06T15:20:54Z',
  26. created_at => '2021-03-06T03:44:12Z',
  27. locations => Array
  28. (
  29. 0 => Array
  30. (
  31. name => 'India',
  32. woeid => 23424848
  33. )
  34.  
  35. )
  36.  
  37. )
  38.  
  39. );
  40.  
  41. //echo json_encode($datas);
  42.  
  43. echo "<pre><table>";
  44. echo "<tr><th>name</th><th>url</th></tr>";
  45. foreach ($datas as $data) {
  46. $trends = $data['trends'];
  47. foreach ($trends as $tweet) {
  48. echo "<tr>";
  49. echo "<td>".$tweet['name']."</td>";
  50. echo "<td>".$tweet['url']."</td>";
  51. echo "</tr>";
  52. }
  53. }
  54. echo "</table></pre>";
Success #stdin #stdout #stderr 0.02s 24788KB
stdin
Standard input is empty
stdout
<pre><table><tr><th>name</th><th>url</th></tr><tr><td>#Allah_In_Quran</td><td>http://t...content-available-to-author-only...r.com/search?q=%23Allah_In_Quran</td></tr><tr><td>Last Prophet Saint Rampal Ji</td><td>http://t...content-available-to-author-only...r.com/search?q=%22Last+Prophet+Saint+Rampal+Ji%22</td></tr></table></pre>
stderr
PHP Warning:  Use of undefined constant as_of - assumed 'as_of' (this will throw an Error in a future version of PHP) in /home/NhJRsW/prog.php on line 25
PHP Warning:  Use of undefined constant created_at - assumed 'created_at' (this will throw an Error in a future version of PHP) in /home/NhJRsW/prog.php on line 26
PHP Warning:  Use of undefined constant locations - assumed 'locations' (this will throw an Error in a future version of PHP) in /home/NhJRsW/prog.php on line 27
PHP Warning:  Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in /home/NhJRsW/prog.php on line 31
PHP Warning:  Use of undefined constant woeid - assumed 'woeid' (this will throw an Error in a future version of PHP) in /home/NhJRsW/prog.php on line 32