PHP removes '#' from string
Jun 05, 2020 pm 05:09 PMPHP removes the "#" in the string
In PHP, you can use the "str_replace ()" function to replace the "#" in the string. #" removal. This function is used to replace substrings. Its syntax is "str_replace(search,replace,subject)". The removal method only needs to replace the "#" in the characters with empty characters.
Parameter description
If search and replace are arrays, then str_replace() will perform mapping replacement on subject. If the number of replace values is less than the number of search values, additional replacements will be performed using empty strings. If search is an array and replace is a string, then the replacement of each element in search will always use this string. This conversion does not change case.
If search and replace are both arrays, their values will be processed in sequence.
search
The target value to find, which is needle. An array can specify multiple targets.
replace
Replacement value for search. An array can be used to specify multiple replacements.
subject
Array or string to perform replacement. That is haystack.
If subject is an array, the replacement operation will traverse the entire subject, and the return value will also be an array.
count
If specified, its value will be set to the number of times replacement occurred.
Recommended tutorial: "PHP Tutorial"
The above is the detailed content of PHP removes '#' from string. 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
