User Tools

Site Tools


str_replace

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

str_replace [2019/12/17 12:13] (current)
Line 1: Line 1:
 +====== str_replace ======
 +----
 +str_replace - Replace all occurrences of the search string with the replacement string
  
 +
 +===== Description =====
 +  str_replace("​$search","​$replace","​$subject"​)
 +  ​
 +This function returns a string
 +
 +
 +===== Parameters =====
 +** $search **\\
 +The value being searched for
 +
 +** $replace **\\
 +The replacement value that replaces found search values
 +
 +** $subject **\\
 +The string being searched and replaced on
 +
 +===== Examples =====
 +  $txt="​hello world"
 +  $replaced=str_replace("​o","​uu","​$txt"​)
 +  alert($replaced)
 +  ​
str_replace.txt ยท Last modified: 2019/12/17 12:13 (external edit)