“mobile”/ Voluum
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

PHP array of ALL the TLDs

Discussion in 'Programming and Scripts' started by Graybeard, Apr 30, 2018.

  1. Graybeard

    Graybeard Well-Known Member affiliate

    5,366
    2,631
    113
    I am working on an mailer for my SMTP thought this might be useful in the validation correctly spelled TLDs

    List of Top-Level Domains - ICANN
    below array was truncated by this forum ^^ full list

    but you get the code logic (I hope ;) )

    PHP:
    <?php

         $strings 
    = array("aaa""aarp""abarth""abb""abbott""abbvie""abc""able""abogado""abudhabi""ac""academy""accenture""accountant""accountants""aco""active""actor""ad""adac""ads""adult""ae""aeg""aero""aetna""af""afamilycompany""afl""africa""ag""agakhan""agency""ai""aig""aigo""airbus""airforce""airtel""akdn""al""alfaromeo""alibaba""alipay""allfinanz""allstate""ally""alsace""alstom""am""americanexpress""americanfamily""amex""amfam""amica""amsterdam""analytics""android""anquan""anz""ao""aol""apartments""app""apple""aq""aquarelle""ar""arab""aramco""archi""army""arpa""art""arte""as""asda""asia""associates""at""athleta""attorney""au""auction""audi""audible""audio""auspost""author""auto""autos""avianca""aw""aws""ax""axa""az""azure""ba""baby""baidu""banamex""bananarepublic""band""bank""bar""barcelona""barclaycard""barclays""barefoot""bargains""baseball""basketball""bauhaus""bayern""bb""bbc""bbt""bbva""bcg""bcn""bd""be""beats""beauty""beer""bentley""berlin""best""bestbuy""bet""bf""bg""bh""bharti""bi""bible""bid""bike""bing""bingo""bio""biz""bj""black""blackfriday""blanco""blockbuster""blog""bloomberg""blue""bm""bms""bmw""bn""bnl""bnpparibas""bo""boats""boehringer""bofa""bom""bond""boo""book""booking""bosch""bostik""boston""bot""boutique""box""br""bradesco""bridgestone""broadway""broker""brother""brussels""bs""bt""budapest""bugatti""build""builders""business""buy""buzz""bv""bw""by""bz""bzh""ca""cab""cafe""cal""call""calvinklein""cam""camera""camp""cancerresearch""canon""capetown""capital""capitalone""car""caravan""cards""care""career""careers""cars""cartier""casa""case""caseih""cash""casino""cat""catering""catholic""cba""cbn""cbre""cbs""cc""cd""ceb""center""ceo""cern""cf""cfa""cfd""cg""ch""chanel""channel""chase""chat""cheap""chintai""christmas""chrome""chrysler""church""ci""cipriani""circle""cisco""citadel""citi""citic""city""cityeats""ck""cl""claims""cleaning""click""clinic""clinique""clothing""cloud""club""clubmed""cm""cn""co""coach""codes""coffee""college""cologne""com""comcast""commbank""community""company""compare""computer""comsec""condos""construction""consulting""contact""contractors""cooking""cookingchannel""cool""coop""corsica""country""coupon""coupons""courses""cr""credit""creditcard""creditunion""cricket""crown""crs""cruise""cruises""csc""cu""cuisinella""cv""cw""cx""cy""cymru""cyou""cz""dabur""dad""dance""data""date""dating""datsun""day""dclk""dds""de""deal""dealer""deals""degree""delivery""dell""deloitte""delta""democrat""dental""dentist""desi""design""dev""dhl""diamonds""diet""digital""direct""directory""discount""discover""dish""diy""dj""dk""dm""dnp""do""docs""doctor""dodge""dog""doha""domains""dot""download""drive""dtv""dubai""duck""dunlop""duns""dupont""durban""dvag""dvr""dz""earth""eat""ec""eco""edeka""edu""education""ee""eg""email""emerck""energy""engineer""engineering""enterprises""epost""epson""equipment""er""ericsson""erni""es""esq""estate""esurance""et""etisalat""eu""eurovision""eus""events""everbank""exchange""expert""exposed""express""extraspace""fage""fail""fairwinds""faith""family""fan""fans""farm""farmers""fashion""fast""fedex""feedback""ferrari""ferrero""fi""fiat""fidelity""fido""film""final""finance""financial""fire""firestone""firmdale""fi <<<<missing
     


    if (in_array("
    $tld", $strings))
      {
      echo "
    Match found
      good TLD
       
    \n<p>";
     

      }
    else
      {
      echo "
    Match not found";
      }

     
    Last edited: Apr 30, 2018
  2. CPA Evolution
  3. Certified
    tyoussef

    tyoussef Moderator moderator Certified Vendor Service Manager affiliate

    4,284
    3,984
    113
    yep.
    you just need to define this variable $tld .

    also this

    Code:
    {
      echo "Match not found";
    should be closed like this
    Code:
    {
      echo "Match not found";
    }
     
  4. Graybeard

    Graybeard Well-Known Member affiliate

    5,366
    2,631
    113
    copy and paste LOL ill fix it -- it was in the middle of a script
    Some list over 1000 TLDs now

    All the variables in MY script are defined -- this is just a snippet ...

    do to;
    databasing pdo
    the PHP mail is working and tested to my remote SMTP
    Gmail inboxed a plain text and spam boxed a not so well formated HTML hopefully when cleaned up the HTML messages will inbox also -- we'll see
     
    Last edited: Apr 30, 2018
banners