A piece of code does not quite understand

Source: Internet
Author: User
A piece of code does not quite understand echo"
Last file modification time ". date (" Y-m-d H: I: s) ", $ file_info ['mtime']);

Echo"
Last file modification time"
Add. date ("Y-m-d H: I: s)" to the end of the connection. why do we add these two double quotation marks and put the quotation marks out of the brackets. I don't understand.


Reply to discussion (solution)

Wrong,
Echo"
Last file modification time ". date (" Y-m-d H: I: s ", $ file_info ['mtime']);

Date ("Y-m-d H: I: s", $ file_info ['mtime']);
Date ("Y-m-d H: I: s)", $ file_info ['mtime']);

With an extra bracket, you can understand it after running it.

Wrong. The brackets should not exist.

Wrong. The brackets should not exist.

Wrong. The brackets should not exist.

Your code:. date ("Y-m-d H: I: s)", $ file_info ['mtime']);
Change to. date ("Y-m-d H: I: s", $ file_info ['mtime']);

What you think you don't understand is the last thing you shouldn't understand.
If the string is not over, you cannot take it out of context.

The string can save any content, including the date format string.

You treat date ("Y-m-d H: I: s", $ file_info ['mtime']) as a string
PHP concatenates a string with a dot (.)

Echo"
Last file modification time ". date (" Y-m-d H: I: s ", $ file_info ['mtime']);

Discussion triggered by a careless person

Thank you! you have learned a lot at the beginning.

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.