Home > Backend Development > PHP Problem > How to remove specified string in php

How to remove specified string in php

藏色散人
Release: 2023-03-06 14:40:02
Original
2787 people have browsed it

php method to remove the specified string: first create a PHP sample file; then remove the specified string through the "substr_replace($a,"",$count,2);" method; finally output the result through echo That’s it.

How to remove specified string in php

Recommended: "PHP Video Tutorial"

PHP code to find the specified string in the string and delete it

$a = "abcababa"; 
$count=strpos($a,"ab"); 
$str=substr_replace($a,"",$count,2);
Copy after login

Output result: cababa

The above is the detailed content of How to remove specified string in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template