PHP 获取数组中的下一个元素
我有 2 个运输区域,A 和 A。 B. A区订单每周一、三、四发货。星期五,而 B 区是星期二、星期四、星期六。对于每个订单,交货日安排在下一个可用日,具体取决于区域。请考虑,如果有人在周一下订单,货物将在下一个可用日期交付,即 B 区为周二,A 区为周三。
到目前为止,一切正常,但我需要做最后一件事,这代码是 http://ideone.com/vpL0N
请转到最后几行并阅读我的评论,它解释了我需要什么。我相信如果我前进到 $zones 数组中的下一个元素,它会起作用,但无法弄清楚。
谢谢!
I have 2 shipping zones, A & B. Orders for zone A are delivered each Monday, Wednesday & Friday, whereas zone B is on Tuesday, Thursday, Saturday. For each order, the delivery day is scheduled for the NEXT AVAILABLE day, depending on the zone. Please consider that if someone places an order on Monday the goods will be delivered on the NEXT available date, that would be Tuesday for zone B and Wednesday for zone A.
So far it works ok but there's one last thing I need to do, this is the code http://ideone.com/vpL0N
Please go down to the last lines and read my comment, it explains what i need. I believe it would work if I advanced to the next element in the $zones array, cant' figure it out though.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 php next 方法来获取数组中的下一个值。
http://php.net/manual/en/function.next.php
you can use php next method to get next value in array.
http://php.net/manual/en/function.next.php