PHP implementation method of getting weeks based on timestamp

Source: Internet
Author: User
The examples in this article describe how PHP implements the week-by-time timestamp. Share to everyone for your reference, as follows:

Gets the number of weeks of a timestamp, and the number of weeks after the next few days

which

$time Representative Time

$i start today.

The sample code is as follows:

function Gettimeweek ($time, $i = 0) {  $weekarray = array ("One", "two", "three", "four", "five", "six", "Day");  $oneD = * *;  Return "Week". $weekarray [Date ("W", $time + $oneD * $i)];} $time =time (); Echo Gettimeweek ($tiem);

More readers interested in PHP related content can view the topic: "PHP Date and Time usage summary", "PHP Object-oriented Programming tutorial", "PHP string (String) Usage Summary", "Php+mysql database operation Getting Started tutorial" and " A summary of common PHP database operation techniques

I hope this article is helpful to you in PHP programming.

The above describes the PHP implementation based on the time stamp to obtain the weeks of the method, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.