PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
You are using break which STOPS the most resent foreach. You want continue which says skip the rest of the block of the most recent foreach, so then it will continue on with the next number (instead of completely stopping it).