Answers for "insert into string position php"

PHP
2

php insert character into string

$newstr = substr_replace($oldstr, $str_to_insert, $pos, 0);
Posted by: Guest on June-04-2020
0

php add string inside string at position

<?php

$string = 'I am happy today.';
$replacement = 'very ';

echo substr_replace($string, $replacement, 4, 0); // I am very happy today.
Posted by: Guest on October-08-2021

Code answers related to "insert into string position php"

Browse Popular Code Answers by Language