php 正则表达式怎么匹配标签里面的style?

$str = '<div style="margin:0px;text-align:left;padding:0px;">任意内容</div>';
$reg = '#<div style=".*">(.*)</div>#';
preg_match_all($reg , $str , $matches);
var_dump($matches);

https://zhidao.baidu.com/question/332235315308735045.html

posted @ 2018-02-01 15:50  码农编程进阶笔记  阅读(29)  评论(0编辑  收藏  举报
返回顶部 有事您Q我