substr_replace

PHP 4, PHP 5, PHP 7, PHP 8
substr_replace - Replace text within a portion of a string

Example #1 Using substr_replace to replace multiple strings at once

Result: A: YYY; B: YYY; C: YYY A: AAA; B: BBB; C: CCC A: AAAXX; B: BBBX; C: CCC
PHP Version:

Example #2 Simple substr_replace examples

PHP Version:


Example #3 of substr_replace

PHP Version:


Function substr_replace:

Strings Functions

Most used PHP functions