01 |
{dede:field.body runphp=yes} |
04 |
$search = '/(<img.*?)width=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is'; |
05 |
$search1 = '/(<img.*?)height=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is'; |
06 |
$search2 = '#(<img.*?style=".*?)width:\d+px;([^"]*?.*?>)#i'; |
07 |
$search3 = '#(<img.*?style=".*?)height:\d+px;([^"]*?.*?>)#i'; |
08 |
$content = preg_replace($search,'$1$3',$str); |
09 |
$content = preg_replace($search1,'$1$3',$content); |
10 |
$content = preg_replace($search2,'$1$2',$content); |
11 |
$content = preg_replace($search3,'$1$2',$content); |
13 |
//@me = str_replace('/uploads/allimg/', $cfg_basehost.'/uploads/allimg/', $content);//手机版图片使用绝对路径 |
|