★ wanayoo — archive 1999 http://il.php.net/manual/function.str-replace.php3Nouvelle recherche | Portail wanayoo

PHP3 Home Page

Manual Table of Contents
Up to Strings
Quick Reference
Strings
* AddSlashes
* bin2hex
* Chop
* Chr
* chunk_split
* convert_cyr_string
* crypt
* echo
* explode
* flush
* get_meta_tags
* htmlspecialchars
* htmlentities
* implode
* join
* ltrim
* md5
* nl2br
* Ord
* parse_str
* print
* printf
* quoted_printable_decode
* QuoteMeta
* rawurldecode
* rawurlencode
* setlocale
* similar_text
* soundex
* sprintf
* strchr
* strcmp
* strcspn
* strip_tags
* StripSlashes
* strlen
* strrpos
* strpos
* strrchr
* strrev
* strspn
* strstr
* strtok
* strtolower
* strtoupper
* str_replace
* strtr
* substr
* trim
* ucfirst
* ucwords
Manual: str_replace
View the source code for this pageSearch the site



Previous page
 strtoupper
strtr 
Next page


str_replace

str_replace -- Replace all occurrences of needle in haystack with str

Description

string str_replace(string needle, string str, string haystack);

This function replaces all occurences of needle in haystack with the given str. If you don't need fancy replacing rules, you should always use this function instead of ereg_replace().

Example 1. str_replace() example

$bodytag = str_replace("%body%", "black", "<body text=%body%>");
      

This function is binary safe.

See also ereg_replace().


 About Notes


Previous page
 strtoupper
strtr 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
Israel
Some elements of this website are subject to copyright.