Published
- 1 min read
php add string inside string at position
The solution for this is noted below
php add string inside string at position
Solution
<?php
$string = 'I am happy today.';
$replacement = 'very ';
echo substr_replace($string, $replacement, 4, 0); // I am very happy today.
Try other methods by searching on the site. That is if this doesn’t work