Ladies and gentlemen, let's check the syntax. it's difficult for me to look at the usage of quotation marks! Solution

Source: Internet
Author: User
Ladies and gentlemen, let's check the syntax. it's difficult for me to look at the usage of quotation marks! I plan to output a piece of XML in PHP. there is always an error and the syntax is incorrect! PHPcode $ strXML. & quot; & lt; setname & quot; date_format ($ row [& quot; DatePro & quot;], % Y-% m) & quot; value & quot ;. $ row [& q Ladies and gentlemen, let's check the syntax. it's hard for me to look at the usage of quotation marks!
I plan to output a piece of XML in PHP. there is always an error and the syntax is incorrect!
PHP code
  $strXML .= "
  ";


Please advise. thank you !!

------ Solution --------------------
PHP code
Date_format ($ row ["DatePro"], '% Y-% M') missing connectors
------ Solution --------------------
$ StrXML. =" ";

------ Solution --------------------
Date_format has Format requirements for parameters.


You can try date_format (date_create ($ row ["DatePro"]), '% Y-% M ')
------ Solution --------------------
The first parameter of date_format should be DateTime-type data.
------ Solution --------------------
I have read the function description and added $ date = date_create ($ xxx). let's take a look, as we have already mentioned in the previous section 10 thousand.

------ Solution --------------------
PHP code
Strtotime ("Y-m-d H: I: s") // date ("Y-m-d H: I: s", time ()) // output the timestamp format to the format

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.