Home > Backend Development > PHP Problem > How to delete specified characters in php

How to delete specified characters in php

藏色散人
Release: 2023-03-07 18:48:02
Original
2966 people have browsed it

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;
?>
Copy after login

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!

Related labels:
php
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template