Request PHP or JS to call the Loop list hyperlink text for different colors

Source: Internet
Author: User
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 csdnhttp://www.google.com | Hello Google http://www.baidu.com | Baidu Network Http://www.163.com | Netease

Solve online and other


Reply to discussion (solution)

Jquery

Hello Csdn
Hello Google
Baidu Network
Netease

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}

Jquery

Hello Csdn
Hello Google
Baidu Network
Netease









Thank you very much for using your code to achieve the results I want.
  • 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.