Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. array:3 [
  2. 0 => {
  3. "applied_date": "10-10"
  4. "count": 1
  5. }
  6. 1 => {
  7. "applied_date": "10-14"
  8. "count": 1
  9. }
  10. 2 => {
  11. "applied_date": "10-15"
  12. "count": 1
  13. }
  14. ]
  15.  
  16. <?php
  17. // Array representing a possible record set returned from a database
  18. $records = array(
  19. array(
  20. "applied_date"=> "10-10",
  21. "count"=> 1
  22. ),
  23. array(
  24. "applied_date"=> "10-10",
  25. "count"=> 1
  26. ),
  27. array(
  28. "applied_date"=> "10-10",
  29. "count"=> 1
  30. )
  31. );
  32.  
  33. $applied_date = array_column($records, 'applied_date');
  34. $count = array_column($records, 'count');
  35. print_r($applied_date);
  36. print_r($count);
  37.  
  38.  
  39. ?>
  40.  
  41. $applied_dates_arr = [];
  42. $count_arr = []
  43.  
  44. foreach ($counts as $el) {
  45. $applied_dates_arr[] = $el['applied_date'];
  46. $count_arr[] = $el['count'];
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement