Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Results returned as either:
- Array
- (
- [30871652] => ryan@fusionized.com
- [30871649] => ryan@fusionized.com
- [30871648] => ryan@fusionized.com
- [30871651] => ryan@fusionized.com
- [30871650] => ryan@fusionized.com
- [30871654] => ryan@fusionized.com
- [30871653] => ryan@fusionized.com
- [30871643] => ryanduff@gmail.com
- [30871644] => ryanduff@gmail.com
- [30871645] => ryanduff@gmail.com
- [30871647] => ryanduff@gmail.com
- [30871656] => ryanduff@gmail.com
- [30871655] => ryanduff@gmail.com
- [30871646] => ryanduff@gmail.com
- )
- //or can be returned as:
- Array
- (
- [0] => Array
- (
- [lead_id] => 30871656
- [email] => ryanduff@gmail.com
- )
- [1] => Array
- (
- [lead_id] => 30871655
- [email] => ryanduff@gmail.com
- )
- [2] => Array
- (
- [lead_id] => 30871653
- [email] => ryan@fusionized.com
- )
- [3] => Array
- (
- [lead_id] => 30871654
- [email] => ryan@fusionized.com
- )
- [4] => Array
- (
- [lead_id] => 30871651
- [email] => ryan@fusionized.com
- )
- )
- /**
- * Basically need to sort and count by email address on a variable limit.
- * Once the count is reached, the id's associated with any addional entries are added to a separate array to be deleted.
- *
- * Not sure the best approach to sort and filter though. Ideas?
- */
- // 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:
- Array
- (
- [0] => 30871651
- [1] => 30871650
- [2] => 30871654
- [3] => 30871653
- [4] => 30871647
- [5] => 30871656
- [6] => 30871655
- [7] => 30871646
- )
- //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