Elseif and elseif in php

Source: Internet
Author: User
Tags parse error
I haven't noticed before. I know that when I enter the company, I read more code and often see the elseif Branch. I often use elseif, so I noticed that, since they can all use it, where are they not? Through the query, it turns out that there is a little difference: 1. One can use a colon, and the other can not? Php * Incorre

In the past, I did not notice that I knew that when I entered the company, I saw more code and often saw the branch of elseif, while I often used else if. So I noticed that, since they can all use it, where are they not? Through the query, it turns out that there is a little difference: 1. One can use a colon, and the other can not? Php/* Incorre

In the past, I did not notice that I knew that when I entered the company, I saw more code and often saw the branch of elseif, while I often used else if. So I noticed that, since they can all use it, where are they not?

Through the query, it turns out that there is a little difference: 1. One can use a colon, and the other cannot

 $ B): echo $. "is greater ". $ B; else if ($ a = $ B): // Will not compile. echo "The above line causes a parse error. "; endif;/* Correct Method: */if ($ a> $ B): echo $. "is greater ". $ B; elseif ($ a = $ B): // Note the combination of the words. echo $. "equals ". $ B; else: echo $. "is neither greater than or equal ". $ B; endif;?>

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.