函式:str_replace() |
str_replace字串取代。 语法: string str_replace(string needle, string str, string haystack); 传回值: 字串 函式种类: 资料处理
本函式将字串 str 代入 haystack 字串中,将所有的 needle 置换成 str。mlevine@adtraq.com (11-Apr-1999) 指出在 PHP 3.0.7 版,本函式有些 bug,而 nadeem@bleh.org (05-Jun-1999) 补充在 PHP 3.0.8 版本函式就回复正常了。
下例将 %body% 以 black 取代
|