• 15-09-2018, 18:30:08
    #1
    Alıntı
    google.com.tr domain lookup results from whois.nic.tr server* Registrant:Google Inc.1600 Amphitheatre ParkwayMountain View CAOut of Turkey,United States of Americadns-admin@google.com+ 1-650-2530000-+ 1-650-2530001-** Administrative Contact:NIC Handle: mi154-metuOrganization Name: MarkMonitor, IncAddress: Hidden upon user requestPhone: Hidden upon user requestFax: Hidden upon user request** Technical Contact:NIC Handle: btl1-metuOrganization Name: Beril Teknoloji Bilişim Yayıncılık Ticaret A.Ş.Address: Hidden upon user requestPhone: Hidden upon user requestFax: Hidden upon user request** Billing Contact:NIC Handle: btl1-metuOrganization Name: Beril Teknoloji Bilişim Yayıncılık Ticaret A.Ş.Address: Hidden upon user requestPhone: Hidden upon user requestFax: Hidden upon user request** Domain Servers:ns1.google.comns2.google.comns3.google.com ns4.google.com** Additional Info:Created on..............: 2001-Aug-23.Expires on..............: 2019-Aug-22.
    Merhabalar yukarıdaki yazıdan ns adreslerini çekmek istiyorum. Kolay gibi gözüküyor 4 saattir beceremedim yardım edebilir misiniz? Örneğin bunu alttaki gibi nasıl yapabilirim?

    Array(
    1=>ns1.google.com,
    2=>ns2.google.com,
    3=>ns3.google.com,
    4=>ns4.google.com,
    )
  • 15-09-2018, 18:45:09
    #2
    expolde ile yapılabilir.
    $x1 = explode("Domain Servers:",$text);
    $x2 = explode("**", $x1[1] );
    $dnsler = explode(" ", $x2[0]); // aradıgınız array bu

    illa regexp ile derseniz pcden yazarım.
  • 15-09-2018, 19:25:01
    #3
    crooper adlı üyeden alıntı: mesajı görüntüle
    expolde ile yapılabilir.
    $x1 = explode("Domain Servers:",$text);
    $x2 = explode("**", $x1[1] );
    $dnsler = explode(" ", $x2[0]); // aradıgınız array bu

    illa regexp ile derseniz pcden yazarım.
    Hocam bende bu şekilde çıktı oldu:

    Array(
    1=>ns1.google.comns2.google.comns3.google.com ns4.google.com)

    fakat ben her ns adresinin farklı dizide olmasını istiyordum.
  • 15-09-2018, 19:57:36
    #4
    Üyeliği durduruldu
    $data = "google.com.tr domain lookup results from whois.nic.tr server* Registrant:Google Inc.1600 Amphitheatre ParkwayMountain View CAOut of Turkey,United States of Americadns-admin@google.com+ 1-650-2530000-+ 1-650-2530001-** Administrative Contact:NIC Handle: mi154-metuOrganization Name: MarkMonitor, IncAddress: Hidden upon user requestPhone: Hidden upon user requestFax: Hidden upon user request** Technical Contact:NIC Handle: btl1-metuOrganization Name: Beril Teknoloji Bilişim Yayıncılık Ticaret A.Ş.Address: Hidden upon user requestPhone: Hidden upon user requestFax: Hidden upon user request** Billing Contact:NIC Handle: btl1-metuOrganization Name: Beril Teknoloji Bilişim Yayıncılık Ticaret A.Ş.Address: Hidden upon user requestPhone: Hidden upon user requestFax: Hidden upon user request** Domain Servers:ns1.google.comns2.google.comns3.google.com ns4.google.com** Additional Info:Created on..............: 2001-Aug-23.Expires on..............: 2019-Aug-22. ";
    
    preg_match("/Servers:(.*?)**/i", $data, $output);
    preg_match_all("/(.*?).[^.]+.(com|net|org)/i", $output[1], $ns);
    print_r($ns);
    Çıktı :
    Array ( [0] => Array ( [0] => ns1.google.com [1] => ns2.google.com [2] => ns3.google.com [3] => ns4.google.com ) [1] => Array ( [0] => ns1 [1] => ns2 [2] => ns3 [3] => ns4 ) [2] => Array ( [0] => com [1] => com [2] => com [3] => com ) )
  • 15-09-2018, 21:01:33
    #5
    UsrBin adlı üyeden alıntı: mesajı görüntüle
    $data = "google.com.tr domain lookup results from whois.nic.tr server* Registrant:Google Inc.1600 Amphitheatre ParkwayMountain View CAOut of Turkey,United States of Americadns-admin@google.com+ 1-650-2530000-+ 1-650-2530001-** Administrative Contact:NIC Handle: mi154-metuOrganization Name: MarkMonitor, IncAddress: Hidden upon user requestPhone: Hidden upon user requestFax: Hidden upon user request** Technical Contact:NIC Handle: btl1-metuOrganization Name: Beril Teknoloji Bilişim Yayıncılık Ticaret A.Ş.Address: Hidden upon user requestPhone: Hidden upon user requestFax: Hidden upon user request** Billing Contact:NIC Handle: btl1-metuOrganization Name: Beril Teknoloji Bilişim Yayıncılık Ticaret A.Ş.Address: Hidden upon user requestPhone: Hidden upon user requestFax: Hidden upon user request** Domain Servers:ns1.google.comns2.google.comns3.google.com ns4.google.com** Additional Info:Created on..............: 2001-Aug-23.Expires on..............: 2019-Aug-22. ";
    
    preg_match("/Servers:(.*?)**/i", $data, $output);
    preg_match_all("/(.*?).[^.]+.(com|net|org)/i", $output[1], $ns);
    print_r($ns);
    Çıktı :
    Array ( [0] => Array ( [0] => ns1.google.com [1] => ns2.google.com [2] => ns3.google.com [3] => ns4.google.com ) [1] => Array ( [0] => ns1 [1] => ns2 [2] => ns3 [3] => ns4 ) [2] => Array ( [0] => com [1] => com [2] => com [3] => com ) )
    Hocam çok teşekkür ederim ama şöyle bir hata verdi:
    preg_match(): Compilation failed: nothing to repeat at offset 14 in
    İlgili satır bu:
    preg_match("/Servers:(.*?)**/i", $data, $output);
    galiba * sembolünden dolayı sorun çıkıyor.
    preg_match("/Servers:(.*?)**/i", $data, $output);
    şeklinde yapınca da hata vermiyor ama veriyi de çekmiyor. Yardım edebilirseniz çok minnettar kalırım.

    Not * sembolünün önüne eğik çizgi koymuştum nedense kodda gözükmemiş.
  • 15-09-2018, 21:14:17
    #6
    Üyeliği durduruldu
    /^([a-zA-Z0-9]+|[a-zA-Z0-9]**[a-zA-Z0-9]*)(.[a-zA-Z0-9]+){2,3}$/g

    Bunu kullanın bu sizin işinizi çözecektir, fakat tüm nameserverları alır yazıdaki.
  • 15-09-2018, 21:35:14
    #7
    n3pix adlı üyeden alıntı: mesajı görüntüle
    /^([a-zA-Z0-9]+|[a-zA-Z0-9]**[a-zA-Z0-9]*)(.[a-zA-Z0-9]+){2,3}$/g

    Bunu kullanın bu sizin işinizi çözecektir, fakat tüm nameserverları alır yazıdaki.
    Hocam bu kodda php yazım hatası alıyorum. Sondaki g harfinden kaynaklanıyor heralde. Yardım edebilir misiniz?
  • 15-09-2018, 21:37:59
    #8
    Üyeliği durduruldu
    [PHPR]**/PHPR] olarak deneyin
  • 15-09-2018, 21:39:19
    #9
    Üyeliği durduruldu
    ASametYildirim adlı üyeden alıntı: mesajı görüntüle
    Hocam bu kodda php yazım hatası alıyorum. Sondaki g harfinden kaynaklanıyor heralde. Yardım edebilir misiniz?
    preg_match_all('/^([a-zA-Z0-9]+|[a-zA-Z0-9]**[a-zA-Z0-9]*)(.[a-zA-Z0-9]+){2,3}$/', $input, $output);
    print_r($output);
    Buyrun