Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. Array (
  2. [0] => stdClass Object (
  3. [id] => 20
  4. [news_title] => Startup finance docs in GitHub
  5. [news_url] => http://venturebeat.com/2013/03/06/fenwick-west-github/
  6. [news_root_domain] => venturebeat.com
  7. [news_category] =>
  8. [news_submitter] => 4
  9. [news_time] => 2013-03-06 11:20:03
  10. [news_points] => 0
  11. )
  12. [1] => stdClass Object (
  13. [id] => 21
  14. [news_title] => The problems with righteous investing
  15. [news_url] => http://gigaom.com/2013/03/07/the-problems-with-righteous-investing/
  16. [news_root_domain] => gigaom.com
  17. [news_category] =>
  18. [news_submitter] => 4
  19. [news_time] => 2013-03-08 09:14:17
  20. [news_points] => 0
  21. )
  22. )
  23.  
  24. print_r $this->$record[0]->news_title;
  25.  
  26. $arr = Array();
  27.  
  28. $obj0 = new stdClass;
  29. $obj0->id = 123;
  30. $obj0->news_title = "some title 0";
  31. //etc...
  32. $obj1 = new stdClass;
  33. $obj1->id = 124;
  34. $obj1->news_title = "some title 1";
  35. //etc...
  36.  
  37. $arr[0] = $obj0;
  38. $arr[1] = $obj1;
  39.  
  40. print_r($arr);
  41.  
  42. print_r($arr[0]);
  43.  
  44. echo $arr[0]->id;
  45.  
  46. echo $this -> record[0] -> title;
  47.  
  48. echo {$this -> record[0]} -> title;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement