merhaba , aşağıda 5 sayfaya bağlanarak, 5 video adresini de alıp kaydetmek istiyorum, adresleri alıyorum ama kayıtta sadece 1 tane kaydediyor. ' $my_post['post_content'] = $film;' nasıl 5 videonunda kaydedilmesini sağlarım acaba ?
<?php
for($i=0; $i<5; $i++){
$cek = file_get_contents('xxx.xom');
preg_match_all('@</span>(.*?)</a>(.*?)<a href="(.*?)"><span>@si',$cek,$link);
$icerik_cek=$link[3][$i];
$baglan=file_get_contents($icerik_cek);
preg_match_all('@<!--baslik:(.*?)-->(.*?)<iframe src="(.*?)"@si',$baglan,$al);
$id = strip_tags($al[3][0]);
$film = '<iframe width="640" height="360" src="'.$id.'" frameborder="0" allowfullscreen></iframe>';
$my_post = array();
$my_post['post_title'] = 'baslık deneme';
$my_post['post_content'] = $film;
$my_post['post_status'] = 'draft';
$my_post['post_author'] = 1;
$my_post['post_category'] = array(215);
}
$post_id = wp_insert_post($my_post);
?>