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}