In the foreach loop, how do I write this change?

Source: Internet
Author: User
In the foreach loop, how to write this post with such a change is the same as the output content edited by albb_num1 at 2014-10-1921: 34: 12, but the style is different. the first output <; strong & gt; & lt; a & nbsp; href # & gt; Question 1 & lt; a & gt; & lt; strong & gt; & nbsp; in foreach loop, how to write such a change?

This post was last edited by albb_num1 at 21:34:12

The output content is the same, but the style is different,
First output
Question 1
Second output
Question 2 | (no Tag followed by |)
And so on
I only wrote the first one, and the second one won't be written. I also know how to use the judgment, but I don't know how to write it.

  

11 & $ value ['navigation _ id'] <27) {?>
Question 1



------ Solution ----------------------
For a simple reference:
$ Array = array );
$ Num = 1;
Foreach ($ array as $ key => $ value ){
If ($ num % 2 = 0 ){
Echo'Question '. $ value .'
------ Solution ----------------------
';
} Else {
Echo'Question '. $ value .'';
}
$ Num ++;
}

Is:

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.