Rob Avery IV Rob Avery IV - 4 months ago 7x
PHP Question

php: Delete specific index from string?

I want to be able to specify an index in a string and remove it.

I have the following:

"Hello World!!"

I want to remove the 4th index (
in Hello). Here would be the end result:

"Hell World!!"

I've tried
, but that hasn't worked. I've Googled how to do this and that's what everyone says, but it hasn't worked for me. Maybe I wasn't using it right, idk.

$str="Hello World";
$str1 = substr($str,0,4);
$str2 = substr($str,5,7);
echo $str1.$str2;