This is a method of deleting arbitrary character string from character string with php. Use str_replace().
To delete an arbitrary character string from a character string, use str_replace(). str_replace() is a string substitution function.
<?php $str1 = "aaabbbcccdddeeeccc"; $str2 = "ccc"; $result = str_replace($str2, '', $str1); echo $result;
Delete "ccc" from the character string. The result is "aaabbbdddeee".