Chen Log

陳洛格

Thinkphp 模板内 str_replace的使用方法

leave a comment »

原PHP的使用方法爲:

// Provides: <body text=’black’>
$bodytag = str_replace(“%body%”, “black”, “<body text=’%body%’>”);

Thinkphp 模板内 str_replace的使用方法如下:

$order=2012-04-12
{$order | str_replace=’-‘,”,###}

顯示結果(去掉 – 字元):
20120412

### 這個字元代表帶入前面的  $order 變數

Advertisements

Written by chenagw

2012/04/20 at 16:47

Posted in Uncategorized

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: