function Baglan($url){
$curl=curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
$cikti = curl_exec($curl);
curl_close($curl);
return str_replace(array("n","t","r"), null, $cikti);
}
$Baglan = Baglan('https://www.r10.net');
include("wp-config.php");
$title=$_POST['title'];
$baslik=$title;
preg_match('#<title>(.*?)" /></title>', $Baglan, $baslik);
$my_post = array();
$my_post['post_title'] = $baslik;
$my_post['post_content'] = 'deneme';
$my_post['post_status'] = 'publish';
$my_post['post_author'] = 1;
$my_post['post_category'] = 0;
$the_post_id = wp_insert_post( $my_post );
Kodları ile r10 un titlesini wordpress içeriğime çekmek istiyorum ama çekemiyorum $baslik kodu ile hiç bir şey gelmiyor. Ama print_r ($baslik); yapınca gözüküyor. Hatayı bulamadım