How to remove characters in php
May 19, 2020 am 11:16 AMHow to remove characters in php?
If you don’t have Chinese, you can use str_replace
str_replace(find,replace,string,count)
str_replace()
The function replaces some characters in the string with other characters ( Case sensitive)
Parameters
find Required. Specifies the value to look for.
replace Required. Specifies the value to replace the value in find.
string Required. Specifies the string to be searched for.
count Optional. Variable counting the number of substitutions.
Example: Replace the character "world" in the string "Hello world!" with "Shanghai"
echo str_replace("world","Shanghai","Hello world!");
Output result:
Hello Shanghai!
Recommendation: " PHP tutorial》
The above is the detailed content of How to remove characters in php. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
