Home >> PHP >> substr_replace() function in PHP

substr_replace() function in PHP

The substr_replace() function used for replaces a part of a string with another string.

Syntax

substr_replace(string,replacement,start_position,length)

Example

echo substr_replace("Hello Ravi","Dear",0);

Output

Dear

Post Your Comment

Next Questions
trim() function
ucfirst() function
ucwords() function
wordwrap() function
array
Array type
Numeric array
Associate array
Multidimensional array
array() function
array_change_key_case() function
array_chunk() function
array_combine() function
array_count_values() function
array_diff() function
array_diff_assoc() function
array_diff_key() function
array_diff_uassoc() function
array_diff_ukey() function
array_fill() function
array_filter() function
array_flip() function
array_intersect() function
array_intersect_assoc() function
array_intersect_key() function

Copyright ©2022 coderraj.com. All Rights Reserved.