How to remove N characters from string by index in PHP

1 Answer

0 votes
$s = "php java c++";

$idx = 3;
 
$s = substr_replace($s, '', $idx, 4);
         
echo $s;



/*
run:

phpa c++

*/

 



answered Jun 20, 2020 by avibootz

Related questions

...