All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
php之str_replace_php资料_编程技术

Writer: delv Article type: Programming skills(编程技巧) Time: 2013/12/29 4:41:15 Browse times: 477 Comment times: 0

php之str_replace_php资料_编程技术


Head photo

Go homepage
Upload pictures
Write articles

php之str_replace_php资料_编程技术-你的首页-uuhomepage.com字符串取代。  语法: 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 取代  ");  echo $bodytag;  ?>  参考  ereg_replace()  提示和注释  注释:该函数对大小写敏感。请使用 str_ireplace() 执行对大小写不敏感的搜索。  注释:该函数是二进制安全的。  例子  例子 1  输出:  Hello John!例子 2  在本例中,我们将演示带有数组和 count 变量的 str_replace() 函数:  输出:  Array  (  [0] => blue  [1] => pink  [2] => green  [3] => yellow  )  Replacements: 1例子 3  输出:  Array  (  [0] => B  [1] =>  [2] => !  )





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.