Home > Article > Backend Development > How to delete specified characters in php
php method to delete specified characters: first create a PHP sample file; then delete the specified characters through "str_replace(array("_","="," "),"",$str);" ;Finally, output the result through echo.
Recommendation: "PHP Video Tutorial"
The operating environment of this tutorial: Windows 7 system, PHP version 5.6, This method works for all brands of computers.
php method to delete specified characters:
The code is as follows:
<?php $str = "我_们_的_=家+园"; $str = str_replace(array("_","=","+"),"",$str); echo $str; ?>
This method is suitable for all brands of computers.
The above is the detailed content of How to delete specified characters in php. For more information, please follow other related articles on the PHP Chinese website!