document.writeln('');
XiunoBBS 修羅論壇獲取最新會員的函數(shù) 會員相關(guān)信息調(diào)用方法 獲取文章中第一張圖片作為標(biāo)題縮放圖
1.XiunoBBS 修羅論壇獲取最新會員的函數(shù)
2.xiunobbs會員相關(guān)信息調(diào)用方法
3.獲取文章中第一張圖片作為標(biāo)題縮放圖
<?php$pattern="/<[img|IMG].*?src=[\|\"](.*?(?:[\.gif|\.jpg|\.png]))[\|\"].*?[\/]?>/";$content = $_thread[message]; //文章內(nèi)容preg_match_all($pattern,$content,$matchContent);if(isset($matchContent[1][0])){$temp = $matchContent[1][0];}?><?php $pattern="/<[img|IMG].*?src=[\|\"](.*?(?:[\.gif|\.jpg|\.png]))[\|\"].*?[\/]?>/"; $content = $_thread[message]; //文章內(nèi)容 preg_match_all($pattern,$content,$matchContent); if(isset($matchContent[1][0])){ $temp = $matchContent[1][0]; } ?><?php$pattern="/<[img|IMG].*?src=[\|\"](.*?(?:[\.gif|\.jpg|\.png]))[\|\"].*?[\/]?>/";$content = $_thread[message];//文章內(nèi)容preg_match_all($pattern,$content,$matchContent);if(isset($matchContent[1][0])){$temp = $matchContent[1][0];}?>
主要是靠正則匹配出文章的圖片,然后選取一個,然后在用$temp 調(diào)用
<img src"<?php echo $temp;?>"><img src"<?php echo $temp;?>"><img src"<?php echo $temp;?>">