我在PHP中有以下数组:
$time = array("09:00AM","09:05AM","09:10AM","09:15AM","09:20AM","09:30AM","12:15PM", "12:20PM", "12:25PM","15:30PM","15:35PM","15:40AM","15:45AM","15:50PM");
我如何回应下面的格式?有人知道这是否可行吗?
09:00AM - 09:30AM
12:15PM - 12:25PM
15:30PM - 15:50PM
我对阵的理解还需要练习。
我试图寻找解决方案,但没有找到任何地方这样做
1条答案
按热度按时间nukf8bse1#
抱歉,这是我的更新脚本:$time =数组(“9:00”、“9:05”、“9:10”、"9:15”、“9:20”、“9:30”、“12:15”、“12:20”、“12:25”、“15:30”、“15:35”、“15:40”、“15:45”、“15:50”);...
基于以上(您的最后一条评论),您可以得到以下结果:
具体代码如下:
请注意,此代码可能会被精炼为简洁。