0
我需要一些幫助,爲我的文章中的所有圖像生成圖像。 目前得到的只有我用這個第一個圖像:創建矢量並獲取所有圖像?
$first_img = '';
$mycontent = $row['post_content'];
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $my1content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a default image
$first_img = "/img/default.png";}
這讓只從文章的第一形象..
所以我需要它,讓所有從文章的圖片,並連續顯示它們。
謝謝
請您可以將代碼粘貼在這裏應該如何?謝謝 – JoinOG
更新了答案,改進了模式。 –