简体   繁体   中英

How to preg_replace these strings using PHP

我有这样的文本<text **** display="none">****</text> any words and htmlcodes <text **** display="none">****</text>我想删除所有这样的字符串,例如<text **** display="none">****</text> ,从<text开始,以</text>结尾,包含display="none"

那这个呢?

$solution = preg_replace("@<text[^>]*display=\"none\"[^>]*>.*?</text>@ims", "", $yourstring);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM