Warning: Invalid argument supplied for foreach() in /home/haberh/public_html/haberBot.php on line 20
bu hatayı alıyorum bunun sebebi nedir ?
Yardımcı olabilirseniz çok sevinirim
Warning: Invalid argument supplied for foreach() in /home/haberh/public_html/haberBot.php on line
4
●415
- 09-08-2015, 14:05:26buyrunufukt51 adlı üyeden alıntı: mesajı görüntüle
public function haberEkle($Sayi){ $sorgu = $this->Curl(anaSite . "/oyunBot.php?sayi=$Sayi&b=1"); $sorgu = json_decode($sorgu, true); foreach($sorgu as $haberler){ $wordpressKontrol = $this->haberKontrol($haberler["baslik"]); if($wordpressKontrol == 0){ $wordpressEkle = array(); $wordpressEkle["post_title"] = $haberler["baslik"]; if(yayinlamaDurumu){ $wordpressEkle["post_status"] = "publish"; } else { $wordpressEkle["post_status"] = "draft"; } $wordpressEkle["post_author"] = 1; $wordpressEkle["post_content"] = $haberler["icerik"]; $wordpressEkle["tags_input"] = implode(",", $haberler["etiket"]); foreach($haberler["kategori"] as $kategori){ if(get_cat_ID($kategori)){ $kategoriler[] = get_cat_ID($kategori); } else { $kategoriler[] = wp_create_category($kategori); } } $wordpressEkle["post_category"] = $kategoriler; $wordpressEkle = wp_insert_post($wordpressEkle); if($wordpressEkle != 0){ $this->resimYukle($haberler["baslik"], $haberler["resim"], $wordpressEkle); foreach($haberler["ozelalan"] as $id => $deger){ update_post_meta($wordpressEkle, $id, $deger); } } } } } - 09-08-2015, 14:11:48$sorgu degeri boş dönüyor sanırım ya da kullanım şekli yanlış.
public function haberEkle($Sayi){ $sorgu = $this->Curl(anaSite . "/oyunBot.php?sayi=$Sayi&b=1"); $sorgu = json_decode($sorgu, true); // den sonra print_r($sorgu); //yazar mısınız sonuç nasıl geliyor buna bakmak lazım. - 09-08-2015, 14:14:58Warning: Invalid argument supplied for foreach() in /home/haberhiz/public_html/haberBot.php on line 20ufukt51 adlı üyeden alıntı: mesajı görüntüle
yine aynı hatayı veriyor hocam