Home  >  Article  >  Backend Development  >  How to delete specified characters in php

How to delete specified characters in php

藏色散人
藏色散人Original
2020-11-23 09:34:022830browse

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.

How to delete specified characters in php

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn