title: How do I distribute the contents of one array into another equally (when the array to be merged is smaller)?
body: <p>PHP. I have two arrays: planets and asteroids. I have more asteroids than I have planets. How do I merge the two arrays so that the asteroids are as evenly distributed among the planets as possible?</p>
  
  <p>Currently I have a zip merge going on, but I end up with a ton of asteroids at the bottom of the array. Ideally I'd like p - a - p - a - p - a but I'd prefer p - a - a - p - a - a - p when there are too many asteroids to distribute evenly.</p>
  
  <p>Also their order is important so even if I distribute three asteroids to every planet they have to stay in the order they were in before they were merged.</p>