Request PHP may js to call the Loop list hyperlink text for different colors

Source: Internet
Author: User
Request PHP or JS to call the Loop list hyperlink text for different colors
This post was last edited by mf0916 on 2015-06-02 18:49:22

My HTML calling code is like this

{Loop $ad _types $u $v}
$v
{/loop}

The code for PHP is

$adlist = explode ("\ n", Str_replace ("\ R", "", $ad));
foreach ($adlist as $url = = $value) {
$arr =explode (' | ', $value);
$ad _types[$arr [0]]= $arr [1];
}

The original code that needs to call the loop if it is

http://www.csdn.net | Hello Csdn
http://www.google.com | Hello Google
http://www.baidu.com | Baidu Network
http://www.163.com | Netease

Solve online and other
------to solve the idea----------------------
Jquery



Hello Csdn

Hello Google

Baidu Network

Netease

------to solve the idea----------------------
What are you, a tab template?
The idea is that if your template has index, it is estimated that you can use index instead of $XX

{php $xx = 1}
{Loop $ad _types $u $v}
{if $xx%2==1}
$v
{Else}
$v
{/if}
{PHP $xx + +}
{/loop}
  • Related Article

    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.