Question : php add string inside string at position
Answered by : wandering-warbler-02dkqzhbsxuf
<?php
$string = 'I am happy today.';
$replacement = 'very ';
echo substr_replace($string, $replacement, 4, 0); // I am very happy today.
Source : https://coderwall.com/p/c6ifsw/simple-way-to-insert-a-string-into-another-string-at-any-position-in-php | Last Update : Fri, 15 Oct 21