", $string);" regular method to replace strings with strings."/> ", $string);" regular method to replace strings with strings.">
Home > Article > Backend Development > How to replace string with regular string in php
php正则字符串替换字符串的方法:首先创建一个PHP示例文件;然后通过“preg_replace($pattern, "", $string);”正则方法实现字符串替换字符串即可。$1$2>
推荐:《PHP视频教程》
php用正则表达式替换部分字符串
例如:
百度
将字符串中 style="max-width:90%"替换掉
百度'; $pattern = '//'; echo preg_replace($pattern, "", $string);
The above is the detailed content of How to replace string with regular string in php. For more information, please follow other related articles on the PHP Chinese website!