replace() public method

Replace all occurences of $search with $replace. See str_replace() function.
public replace ( mixed $search, mixed $replace ) : integer
$search mixed
$replace mixed
return integer
Exemplo n.º 1
0
 public function testApiReplace_ReplacesProperSubstring()
 {
     $search = substr($this->initialString, 3, 3);
     $result = $this->buffer->replace($search, $this->appendString);
     $this->assertSame(1, $result);
     $this->assertSame(substr($this->initialString, 0, 3) . $this->appendString . substr($this->initialString, 6), (string) $this->buffer);
 }