How to use substr replace in PHP

In this article I will explain how substr_replace function can be used in PHP.
  • 1511

substr_replace() function

This function replaces a part of a string with another string.

Syntax

substr_replace(string,replacement,start,lengt

Example

<html>
<body>
<?php
echo substr_replace("Hello Swati","earth",6);
?>
</body>
</html> 

 

Output


substr-replace-php.jpg

You may also want to read these related articles Click here

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.