PHP multi-dimensional array and date and time functions 12 constellation date JavaScript array Python count

Source: Internet
Author: User
PHP multi-dimensional array, date and time: PHP multi-dimensional array and date and time functions: Traversing two-dimensional array vehicle brand inventory sales; f traversing two-dimensional array


  Automobile brandInventorySales volume"; For ($ I = 0; $ I
  
   
"; For ($ j = 0; $ j
   
    
". $ Arr [$ I] [$ j]."";} Echo"";} Echo"";?>
   
  

Date and time functions date ()
Date and time are stored as timestamps in PHP. only the date () function can be used to convert to the readable mode.
Syntax: date (format, timestamp); omitting the second parameter defaults to the current time
Format classification:

  • Y indicates the year in four digits, for example, January 1, 2015.
  • M indicates the month in a year.
  • D indicates the day of the month.
  • L indicates the day of the week

Other characters such as-,., and/can increase the readability of the date.
Output Current date:


  ";ehco date('Y.d.m h:i:s')."
";echo date('Y/d/m h:i:s')."
";?>

Time format:

  • H is in the 12-hour format with the leading 0 and returns the current hour.
  • I has a leading 0 minutes and returns the current minute
  • S with the leading 0 s, returns the current S
  • A lowercase English morning and afternoon (am, pm)

  

Note: The date () in PHP returns the current date and time of the server by default when the second parameter. it may be different from the time in the client browser, which may be because the time zone of the server and client is different.
Date_defaut_timezone_set () can be used to set the time zone.
In PHP, you can use the time () function to obtain the timestamp of the current time, or you can use the mktime () function to convert a certain date to a timestamp, this function returns the Unix timestamp of the date. The Unix timestamp contains the number of seconds between the Unix epoch (January 1, 1970 00:00:00 GMT) and the specified time.
Syntax: mktime (hours, minutes, seconds, months, days, and years );
The strtotime () function of PHP can convert our readable string into a timestamp.

'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
  • '). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script

    The preceding section describes the PHP multi-dimensional array and date and time functions, including the PHP multi-dimensional array and date and time content. if you are interested in the PHP Tutorial, please help.

    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.