Join Up!
104886 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousstr_repeatstr_rot13next
Last updated: Sun, 27 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to German | Spanish

str_replace

(PHP 3>= 3.0.6, PHP 4 )

str_replace --  Nahradit všechny výskyty jednoho řetězce v jiném dalším řetězcem

Popis

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

Tato funkce nahradí všechny výskyty needle v argumentu haystack argumentem str. Pokud nepotřebujete složitá pravidla pro nahrazování, měli byste vždy použít tuto funkci místo ereg_replace().

Příklad 1. Ukázka str_replace()

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

Tato funkce je XXX binárně bezpečná.

Poznámka: Funkce str_replace() byla přidána v PHP 3.0.6, ale až do verze PHP 3.0.8 fungovala špatně.

Viz také: ereg_replace() a strtr().

User Contributed Notes
str_replace
add a note about notes
There are no user contributed notes for this page.
previousstr_repeatstr_rot13next
Last updated: Sun, 27 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST