Home > Article > Backend Development > How to remove specified string in php
php method to remove the specified string: first create a PHP sample file; then remove the specified string through the "substr_replace($a,"",$count,2);" method; finally output the result through echo That’s it.
Recommended: "PHP Video Tutorial"
PHP code to find the specified string in the string and delete it
$a = "abcababa"; $count=strpos($a,"ab"); $str=substr_replace($a,"",$count,2);
Output result: cababa
The above is the detailed content of How to remove specified string in php. For more information, please follow other related articles on the PHP Chinese website!