A code that doesn't quite understand

Source: Internet
Author: User
echo "
File last Modified ". Date (" y-m-d h:i:s) ", $file _info[' mtime ']);

echo "
File last modified time "this paragraph read
appended with the. Date ("y-m-d h:i:s)", the connection is why the two double quotes are added, and why the quotation marks are placed outside the brackets. That's not clear.


Reply to discussion (solution)

Write it wrong,
echo "
File last Modified ". 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 ']);

More than one parenthesis, run down to understand.

Wrongly written, that parenthesis should not have.

Wrongly written, that parenthesis should not have.

Wrongly written, that parenthesis should not have.

Your code:. Date ("y-m-d h:i:s)", $file _info[' mtime ']);
Replace with:. Date ("Y-m-d h:i:s", $file _info[' mtime ']);

Where you don't understand, is the last place you should not understand.
Where the string is not over, you can't get it out of context.

Any content can be saved in a string, including the format string of date

You take date ("Y-m-d h:i:s", $file _info[' Mtime ') as a string
PHP uses dots (.) to stitch strings

echo "
File last modified time. Date ("Y-m-d h:i:s", $file _info[' mtime ']);

A discussion caused by a careless person

Thank you guys for starting out with a lot of basics don't understand knot stickers

  • 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.