<?php //抓取页面图片的时候防止图片403(防止盗链) echo "<meta name='referrer' content='no-referrer'>"; $list = file_get_contents($url); $k = preg_match_all('/<img [^>]* \/>/',$list,$data); $m = preg_grep('/alt/',$data[0]); foreach($m as $v){ echo $v.'<br>'; }
2022-10-09 09:11:20
<?php //抓取页面图片的时候防止图片403(防止盗链) echo "<meta name='referrer' content='no-referrer'>"; $list = file_get_contents($url); $k = preg_match_all('/<img [^>]* \/>/',$list,$data); $m = preg_grep('/alt/',$data[0]); foreach($m as $v){ echo $v.'<br>'; }