Is_file ($ userPath) | file_put_contents ($ xx, $ xx)

Source: Internet
Author: User
It seems that if a file is written, it will not be written. Can this be a simple explanation? I understand ifelse, but I usually use | and & amp; it is used to judge | that is, Who or who meets the needs of a person. & amp; that is, both of them must be used...


It seems that if a file is written, it will not be written. Can this be a simple explanation? There is also a working principle. if I use if else, I understand it, but it is usually used in my eyes. | and & is used for judgment. | that is, Who or who meets the requirements, & that is, both of them must comply with this subtle Writing Method -. -Can you explain it? Thank you, God!

Reply content:


It seems that if a file is written, it will not be written. Can this be a simple explanation? There is also a working principle. if I use if else, I understand it, but it is usually used in my eyes. | and & is used for judgment. | that is, Who or who meets the requirements, & that is, both of them must comply with this subtle Writing Method -. -Can you explain it? Thank you, God!

Short Circuit feature. JudgmentA | BIf a is true, B is not executed. If a is false, B is executed.

Same as above. Add: the first line is judgment.UserPathWhether it is a file, if yes, then directly execute the next line of code; ifUserPathIf it is not a file, execute|AfterFile_put_contentsTo write user configuration itemsUserPath;Why do we have to do this?Because the next line needs to introduce thisUserPathFile

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.