{"id":935,"date":"2014-03-24T13:16:11","date_gmt":"2014-03-24T11:16:11","guid":{"rendered":"http:\/\/www.gncz.net\/?p=935"},"modified":"2014-03-24T13:16:11","modified_gmt":"2014-03-24T11:16:11","slug":"php-xml-veri-cekme-ve-ayristirma","status":"publish","type":"post","link":"https:\/\/gncz.net\/index.php\/php-xml-veri-cekme-ve-ayristirma.html","title":{"rendered":"php xml veri \u00e7ekme ve ayr\u0131\u015ft\u0131rma"},"content":{"rendered":"<p>PHP de Herhangi bir xml verisini b\u00f6l\u00fcmleyip kullanmak i\u00e7in Kullan\u0131lan en \u00f6nemli Y\u00f6ntem DOM nesnesi olmaktad\u0131r. Bu Nesne bir XML veya HTML metnin veya dosyan\u0131n b\u00f6l\u00fcmlenip kullan\u0131lmas\u0131n\u0131 sa\u011flar<br \/>\nSitelerinzde Basit\u00e7e kullnabilece\u011finiz bir \u00f6rne\u011fi vermek istiyorum Herhangi bir web sitesinin i\u00e7erisinde bir linkin var olup olmad\u0131\u011f\u0131n\u0131 kontrol etmek isterseniz sayfa i\u00e7esisindeki a tag\u0131n\u0131 kontrol etmeniz yeterli olcakt\u0131r a tag\u0131 temelde 2 b\u00f6l\u00fcmden olu\u015fur a bildirimi ve href parametresi<br \/>\n\u00d6ncelikle nesnenin yarat\u0131lmas\u0131na bakal\u0131m;<\/p>\n<pre class=\"lang:default decode:true \">$sayfa=file_get_contents(\"http:\/\/www.seowarp.net\");\r\n$dom=new DOMdocument(); \r\n$dom-&gt;loadHTML($sayfa);<\/pre>\n<p>Bu Kodlama ile sayfa i\u00e7eri\u011fi dom nesnesine y\u00fcklenir. Art\u0131k yapman\u0131z gereken \u015fey a taglar\u0131n\u0131 ayr\u0131\u015ft\u0131rmak ve kullan\u0131labilir k\u0131lmakt\u0131r bunun i\u00e7in ;<\/p>\n<pre class=\"lang:default decode:true \">$ahrefs=$dom-&gt;getElementsByTagName(\"a\");<\/pre>\n<p>olacakt\u0131r art\u0131k a taglar\u0131n\u0131n i\u00e7eri\u011fini al\u0131p kontrol edebiliriz<\/p>\n<pre class=\"lang:default decode:true \">$found=false;\r\n$foundurl=\"\";\r\nfor($i=0;$ilength;$i++){\r\n$href=$ahrefs-&gt;item($i)-&gt;attributes-&gt;getNamedItem(\"href\")-&gt;nodeValue;\r\n$urldomain=urltodomainname($href);\r\nif($domain==$urldomain){$found=true;\r\n$foundurl=$href;\r\n$keyword=$ahrefs-&gt;item($i)-&gt;nodeValue;\r\nif(trim($keyword)==\"\")$keyword=\"Anahtar Kelimesiz!\";\r\n}\r\n}<\/pre>\n<p>ve son olarak bulunup bulunmad\u0131\u011f\u0131n\u0131n kontrol\u00fc<\/p>\n<pre class=\"lang:default decode:true \">if($found){\r\nif($ahrefs-&gt;lengthlength.'';\r\nelse echo 'SPAM';\r\n}\"<\/pre>\n<p>Kaynak : Fuub.net<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP de Herhangi bir xml verisini b\u00f6l\u00fcmleyip kullanmak i\u00e7in Kullan\u0131lan en \u00f6nemli Y\u00f6ntem DOM nesnesi olmaktad\u0131r. Bu Nesne bir XML veya HTML metnin veya dosyan\u0131n b\u00f6l\u00fcmlenip kullan\u0131lmas\u0131n\u0131 sa\u011flar Sitelerinzde Basit\u00e7e kullnabilece\u011finiz bir \u00f6rne\u011fi vermek istiyorum Herhangi bir web sitesinin i\u00e7erisinde bir linkin var olup olmad\u0131\u011f\u0131n\u0131 kontrol etmek isterseniz sayfa i\u00e7esisindeki a tag\u0131n\u0131 kontrol etmeniz yeterli olcakt\u0131r a tag\u0131 temelde 2<a class=\"more-link\" href=\"https:\/\/gncz.net\/index.php\/php-xml-veri-cekme-ve-ayristirma.html\">[Devam\u0131n\u0131 Oku&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":936,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20],"tags":[113,116,117,115,114],"_links":{"self":[{"href":"https:\/\/gncz.net\/index.php\/wp-json\/wp\/v2\/posts\/935"}],"collection":[{"href":"https:\/\/gncz.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gncz.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gncz.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gncz.net\/index.php\/wp-json\/wp\/v2\/comments?post=935"}],"version-history":[{"count":2,"href":"https:\/\/gncz.net\/index.php\/wp-json\/wp\/v2\/posts\/935\/revisions"}],"predecessor-version":[{"id":938,"href":"https:\/\/gncz.net\/index.php\/wp-json\/wp\/v2\/posts\/935\/revisions\/938"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gncz.net\/index.php\/wp-json\/wp\/v2\/media\/936"}],"wp:attachment":[{"href":"https:\/\/gncz.net\/index.php\/wp-json\/wp\/v2\/media?parent=935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gncz.net\/index.php\/wp-json\/wp\/v2\/categories?post=935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gncz.net\/index.php\/wp-json\/wp\/v2\/tags?post=935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}