Board logo

标题: smarty replace替换函数详解 [打印本页]

作者: xiexie    时间: 2012-7-7 14:16     标题: smarty replace替换函数详解

<?php
require('class/Smarty.class.php');
$smarty = new Smarty;
$smarty->assign('articleTitle', "Child's Stool Great for Use in Garden.");

$smarty->display('replace.tpl');
?>

{$articleTitle}<br/>
{$articleTitle|replace:"Garden":"Vineyard"}<br/>
{$articleTitle|replace:" ":" robert"}

Child's Stool Great for Use in Garden.
Child's Stool Great for Use in Vineyard.
Child's robert Stool robert Great robert for robert Use robert in robert Garden.








欢迎光临 PHP开发笔记 (http://phpvi.com/) Powered by Discuz! 6.1.0