小编Sit*_*ker的帖子

str替换为掩码文本

我有一些文本,我需要删除前面的代码,我使用这样的很多变种:

$answer = str_replace('<td style="background-color:#80F9CC;">', '', $answer);
$answer = str_replace('<td style="background-color:#E1E3E4;">', '', $answer);
$answer = str_replace('<td style="background-color:#D1D3D4;">', '', $answer);
$answer = str_replace('<td style="background-color:#73F6AB;">', '', $answer);
$answer = str_replace('<td style="background-color:#3CEB88;">', '', $answer);
Run Code Online (Sandbox Code Playgroud)

有没有办法创建一个str_replace函数,将通过一些掩码删除此文本?

php string str-replace

0
推荐指数
1
解决办法
630
查看次数

标签 统计

php ×1

str-replace ×1

string ×1