How to write the If statement in php

Source: Internet
Author: User
{Code ...} in this Code, I want to execute & amp; lt; divclass & quot; clearfixvisible-lg-block & quot; style & quot; clear: both; when $ I % 40; & quot; & amp; gt; & amp; lt; div & amp; gt; statement, and then execute & amp; lt; divclass & quot; when $ I % 20; clearfixvisible-xs-block & quot; style & quot; c...

  

Category not set yet

This code, I want to execute when $ I % 4 = 0

Statement, and then executed when $ I % 2 = 0

How can I write the PHP if statement?
Some of the answers I have tried and the program reports an error.

Then I changed it.


  

Category not set yet

And that's right.

However, this is too ugly to write. I hope the gods can help me modify it and change it to the if else statement. Do not delete other sentences ~

Reply content:

  

Category not set yet

This code, I want to execute when $ I % 4 = 0

Statement, and then executed when $ I % 2 = 0

How can I write the PHP if statement?
Some of the answers I have tried and the program reports an error.

Then I changed it.


  

Category not set yet

And that's right.

However, this is too ugly to write. I hope the gods can help me modify it and change it to the if else statement. Do not delete other sentences ~


      


     

Category not set yet


     

Category not set yet

I read the many files written upstairs.phpLabels are complicated, but they are simple.phpAndhtmlTemplate used in combination, directlyechoThat's all,phpThe code is simple, clear, and easy to understand.


  

";} Else if ($ I % 2 = 0) {echo"

";}Else {echo" category not set yet ";}?>

If ($ I % 2 = 0): echo'

'; Elseif ($ I % 4 = 0): echo'

'; Else: echo' no category yet '; endif;

Category not set yet

Use PHP alternative syntax


      


  

'; If ($ I % 4 = 0) echo'

'; Else echo' no category yet ';?>

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.