Guest User

Untitled

a guest
Oct 9th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. <?php
  2.  
  3. //Results returned as either:
  4.  
  5. Array
  6. (
  7. [30871652] => ryan@fusionized.com
  8. [30871649] => ryan@fusionized.com
  9. [30871648] => ryan@fusionized.com
  10. [30871651] => ryan@fusionized.com
  11. [30871650] => ryan@fusionized.com
  12. [30871654] => ryan@fusionized.com
  13. [30871653] => ryan@fusionized.com
  14. [30871643] => ryanduff@gmail.com
  15. [30871644] => ryanduff@gmail.com
  16. [30871645] => ryanduff@gmail.com
  17. [30871647] => ryanduff@gmail.com
  18. [30871656] => ryanduff@gmail.com
  19. [30871655] => ryanduff@gmail.com
  20. [30871646] => ryanduff@gmail.com
  21. )
  22.  
  23. //or can be returned as:
  24.  
  25. Array
  26. (
  27. [0] => Array
  28. (
  29. [lead_id] => 30871656
  30. [email] => ryanduff@gmail.com
  31. )
  32.  
  33. [1] => Array
  34. (
  35. [lead_id] => 30871655
  36. [email] => ryanduff@gmail.com
  37. )
  38.  
  39. [2] => Array
  40. (
  41. [lead_id] => 30871653
  42. [email] => ryan@fusionized.com
  43. )
  44.  
  45. [3] => Array
  46. (
  47. [lead_id] => 30871654
  48. [email] => ryan@fusionized.com
  49. )
  50.  
  51. [4] => Array
  52. (
  53. [lead_id] => 30871651
  54. [email] => ryan@fusionized.com
  55. )
  56.  
  57. )
  58.  
  59. /**
  60. * Basically need to sort and count by email address on a variable limit.
  61. * Once the count is reached, the id's associated with any addional entries are added to a separate array to be deleted.
  62. *
  63. * Not sure the best approach to sort and filter though. Ideas?
  64. */
  65.  
  66.  
  67. // Second array example trimmed so I'll use the first. In the case of a limit of 3 entries per address the result would be:
  68.  
  69. Array
  70. (
  71. [0] => 30871651
  72. [1] => 30871650
  73. [2] => 30871654
  74. [3] => 30871653
  75. [4] => 30871647
  76. [5] => 30871656
  77. [6] => 30871655
  78. [7] => 30871646
  79. )
  80.  
  81. //This equates to every ID matched on a unique email address past the limit. 3 in this case.
Add Comment
Please, Sign In to add comment