0

We're using SugarCRM to process leads that come in for clients, but would like to cycle through the clients so that the leads are distributed evenly. I suspect it will be just cycling through an array for each new lead that comes in, so I wanted to know how you could cycle through an array using PHP, so that each load prints a new value. I saw this similar question (PHP Cycle through array. Move the first element to the last), but wasn't sure how to repeat it after it had resolved once.

Thanks for your help!

Community
  • 1
  • 1
skipit
  • 1
  • 1
    Normally to "cycle through an array" one would use `each` or `foreach`, but I suspect the leads come in at different times, and so you would therefore need to record whose turn it is next in a database. Perhaps maintain a list of leads that each client has received, so you can work out who has received the least. – halfer Oct 10 '13 at 21:42
  • I think what you are looking for is commonly called `Round Robin` so you might want to look into that as well – JasonDavis Oct 15 '13 at 21:51

0 Answers0