Can I write an ifelse statement in this way? -Php Tutorial

Source: Internet
Author: User
Can I write an ifelse statement in this way? I was going to embed this piece of code into a php script, but it always prompts an error:
Parse error: syntax error, unexpected T_ELSE in C: \ AppServ \ www \ demo \ templates_c \ 1d7c7a527b6335cc7a623305ca940e1findex. tpl. php on line 14

 

This is the first block.

This is the third block.



Error message in zend studio


I hope the experts can help me. I hope my younger brother will be in full swing !!! Thank you !!!!!


Reply to discussion (solution)

There's no problem with this section you just gave. are you still using braces?

It feels okay. how do you get this $ status?

In this way, no error is prompted.

There's no problem with this section you just gave. are you still using braces?
Thank you! The problem has been solved. when I print it cyclically, I must write it like the third floor. I cannot separate the right curly braces from the else statement, and it is the same as the elseif statement, if yes, they cannot be separated!

It feels okay. how do you get this $ status?
Thank you! Actually, it should be written like the third floor!

In this way, no error is prompted.
Solution on the third floor !!!!

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.