I am currently building a simple_html_dom.php script and I am trying to parse all of the data and store it into one string so I can submit the data into my WordPress site, here's what I have so far.
$test = $html->find('.post img', 0);
$src = $test->plaintext;
if (strpos($src, '/wp-content/uploads/20') !== false) {
print '<br>';
$premade = '<img src="'.$src.'" class="data-m" />';
print htmlspecialchars($premade);
}
$my_post = array(
'post_title' => wp_strip_all_tags( trim( $uej ) ),
'post_status' => 'publish',
'post_author' => 1,
'post_content' => $premade,
'post_category' => array(6),
'post_date' => date('Y-m-d H:i:s')
);
This is returning only one result when I print it out, how can I make it so that all of the results are compiled into one string?