搜索
开启辅助访问 切换到宽版

QQ登录

只需一步,快速开始

扫一扫,访问微社区

注册 找回密码
查看: 3420|回复: 0

请教字符截取问题

[复制链接]
发表于 2011-8-23 15:03:50 | 显示全部楼层 |阅读模式
$this->data['products'][] = array(
            'product_id'    => $result['product_id'],
            'name'            => $result['name'],//控制输出的时候字符数为5
            'model'               => $result['model'],
            'rating'              => $rating,
            'stars'               => sprintf($this->language->get('text_stars'), $rating),
            'price'               => $price,
            'options'           => $options,
            'special'             => $special,
            'image'               => $this->model_tool_image->resize($image, 38, 38),
            'thumb'               => $this->model_tool_image->resize($image, $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')),
            'href'                => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']),
           'add'               => $add
                        );
                }
我想在输出的时候把'name'的字符数控制在5个字符,
请大家帮帮忙,怎样改才能控制
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

QQ|手机版|OpenCart - 中文官方网站 ( 蜀ICP备09033774号|人工智能

GMT+8, 2024-4-19 01:44 , Processed in 0.056418 second(s), 21 queries , Gzip On.

快速回复 返回顶部 返回列表