zoukankan      html  css  js  c++  java
  • phpcms 替换超过五条数据时的取法

    在 标题 关键词 来源 摘要 内容 中 可同时填入两条数据 用 | 隔开

    如图:

     {pc:content  action="lists" catid="67" order="id ASC" num="2" moreinfo="1"}
                 {loop $data $key $val}
                 
                 <div class="blog-post">
    					<h4><a href="single.html">{php $title = explode('|', $val[title])}
                        {$title[0]}</a></h4>
    					<div class="post-details">
    						<p>{php $keywords = explode('|', $val[keywords])}
                        {$keywords[0]}
                         <a href="#">{php $keywords = explode('|', $val[keywords])}
                         {$keywords[1]}</a>
                         {php list($copyfrom) = explode('|', $val['copyfrom'])}
                        {$copyfrom}
                        <a href="#">{php $description = explode('|', $val[description])}
                        {$description[0]}</a> 
                         {php $description = explode('|', $val[description])}
                        {$description[1]}
                         </p>
    					</div>
    					<a href="single.html"><img src="{$val[thumb]}" alt="" /></a>
    					<p>{php $content = explode('|', $val[content])}
                        {$content[0]}</p>
    					<p>{php $content = explode('|', $val[content])}
                        {$content[1]}</p>
    					<a class="hvr-shutter-in-vertical button more" href="{$val[url]}">{php $title = explode('|', $val[title])}
                        {$title[1]}</a>
    				</div>
                    
                 {/loop}
                {/pc}
    

      用explode 分割取索引 就好了

  • 相关阅读:
    UVA 125 Numbering Paths
    UVA 515 King
    UVA 558 Wormholes
    UVA 10801 Lift Hopping
    UVA 10896 Sending Email
    SGU 488 Dales and Hills
    HDU 3397 Sequence operation
    数据库管理工具navicat的使用
    javascript封装animate动画
    关于webpack没有全局安装下的启动命令
  • 原文地址:https://www.cnblogs.com/bhmmlxieliming/p/6491113.html
Copyright © 2011-2022 走看看