php method to remove strings from strings: First create a PHP sample file; then use the "str_replace" function or "preg_replace" function to replace the specified string with nothing, that is, delete the specified string.
The operating environment of this article: Windows 7 system, PHP version 5.6, DELL G3 computer.
How to delete a certain string in a string in PHP?
For example, delete "123" in the string "a123abc112233aaccdd321123abcd".
You can use the str_replace function or preg_replace function to replace the specified string with empty, that is to say, delete the specified string:
Copy after login
Recommended: "PHP Video Tutorial"
The above is the detailed content of How to remove string from string in php. For more information, please follow other related articles on the PHP Chinese website!