preg_replace替换a标签解决思路
Jun 13, 2016 pm 01:27 PM
preg_replace替换a标签
怎么写正则,要求a标签样式里出现display:none就把a标签替换成空
------解决方案--------------------
- PHP code
$s = 更多 <a href="http://" style="line-height:27px;color:#444547;margin-right:12px;display:none">更多</a> <a href="http://" style="line-height:27px;color:#444547;margin-right:12px;">更多</a> TXT; echo preg_replace('/<a>]*(?=display:none).+?/is','',$s); <div class="clear"> </div></a>

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Fujifilm X-M5 price expectations rise as leaked selfie display adds complexity to the formerly affordable camera line

Samsung: New, large display based on E Ink technology displays colors and communicates wirelessly

Comparison: Apple Studio Display vs Samsung Smart Monitor M8

Apple Studio Display's power cord is detachable, but requires special tools

Comparison: Apple Studio Display vs LG UltraFine 5K Display: Which one is better?

Boot Camp updated to support Apple Studio Display
