Retrieving Day Names in PHP

前端 未结 7 599
-上瘾入骨i
-上瘾入骨i 2021-01-11 15:44

I need to display to user a list of localized day names (like \'Monday\', \'Tuesday\', ...) in a form. I know ho to get day name of any date. But is there a particular and f

相关标签:
7条回答
  • 2021-01-11 16:33

    I know its been a long time, but what about:

    $timestamp = strtotime('next Sunday');
    $days = array();
    for ($i = 0; $i < 7; $i++) {
     $days[] = strftime('%A', $timestamp);
     $timestamp = strtotime('+1 day', $timestamp);
    }
    

    from how to create array of a week days name in php

    0 讨论(0)
提交回复
热议问题