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 分割取索引 就好了

  • 相关阅读:
    组件基础
    css 手稿
    HTML手稿
    Vmstat命令监控Linux资源并将数据通过图形化方式显示
    JAVA---类和对象
    JAVA---Graphics2D类
    JAVA---数组
    JAVA---图形处理
    JAVA----日历源代码
    SQL常用语句大全
  • 原文地址:https://www.cnblogs.com/bhmmlxieliming/p/6491113.html
Copyright © 2011-2022 走看看