沒人回復(fù)我自己來吧,直接替換文章內(nèi)容圖片路徑,其中$eyou['global']['web_basehost']就是$eyou.global.web_basehost
{php}
$str = $eyou['field']['content'];
$search = '/(<img.*?)width=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is';
$search1 = '/(<img.*?)height=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is';
$search2 = '#(<img.*?style=".*?)width:\d+px;([^"]*?.*?>)#i';
$search3 = '#(<img.*?style=".*?)height:\d+px;([^"]*?.*?>)#i';
$content = preg_replace($search,'$1$3',$str);
$content = preg_replace($search1,'$1$3',$content);
$content = preg_replace($search2,'$1$2',$content);
$content = preg_replace($search3,'$1$2',$content);
$content = str_replace('/uploads/', $eyou['global']['web_basehost'].'/uploads/', $content);
echo $content;
{/php}