Php 从数组中提取图像
你好,下面是代码,我得到了一些内容。 如何使用php简单html dom获得所有img src 我的代码:Php 从数组中提取图像,php,wordpress,simple-html-dom,Php,Wordpress,Simple Html Dom,你好,下面是代码,我得到了一些内容。 如何使用php简单html dom获得所有img src 我的代码: foreach($html->find('div[class=post-single-content box mark-links]') as $table) { $arr44[]= $table->innertext ; } 带有类post单个内容框标记链接的div包含文本和图像尝试以下操作: <?php if ( $post->post_type == 'd
foreach($html->find('div[class=post-single-content box mark-links]') as $table)
{
$arr44[]= $table->innertext ;
}
带有类post单个内容框标记链接的div包含文本和图像尝试以下操作:
<?php if ( $post->post_type == 'data-design' && $post->post_status == 'publish' ) {
$attachments = get_posts( array(
'post_type' => 'attachment',
'posts_per_page' => -1,
'post_parent' => $post->ID,
'exclude' => get_post_thumbnail_id()
) );
if ( $attachments ) {
foreach ( $attachments as $attachment ) {
$class = "post-attachment mime-" . sanitize_title( $attachment->post_mime_type );
$thumbimg = wp_get_attachment_link( $attachment->ID, 'thumbnail-size', true );
echo '<li class="' . $class . ' data-design-thumbnail">' . $thumbimg . '</li>';
}
}
}
?>
im sur另一个网站不介意你窃取他们的内容该代码从一篇文章内容中提取所有图像。