本教程主要主讲从字符串中得出url的域名部份,下面来看看吧。希望对我有帮助。
例如:http://www.phpfensi.com 得到 www.phpfensi.com
- function get_domain($url){
- $pattern = "/[w-] .(com|net|org|gov|cc|biz|info|cn)(.(cn|hk))*/";
- preg_match($pattern, $url, $matches);
- if(count($matches) > 0) {
- return $matches[0];
- }else{
- $rs = parse_url($url);
- $main_url = $rs["host"];
- if(!strcmp(long2ip(sprintf("%u",ip2long($main_url))),$main_url)) {
- return $main_url;
- }else{
- $arr = explode(".",$main_url);
- $count=count($arr);
- $endArr = array("com","net","org","3322");//com.cn net.cn 等情况
- if (in_array($arr[$count-2],$endArr)){
- $domain = $arr[$count-3].".".$arr[$count-2].".".$arr[$count-1];
- }else{
- $domain = $arr[$count-2].".".$arr[$count-1];
- }
- return $domain;
- }// end if(!strcmp…)
- }// end if(count…)
- }// end function
波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
波比源码 » php 从字符串中获取URL中获得域名
波比源码 » php 从字符串中获取URL中获得域名
purchase levaquin for sale levofloxacin 250mg pill
generic aldactone 100mg buy propecia 1mg pill fluconazole cost
ampicillin 500mg cheap buy erythromycin without prescription buy erythromycin 250mg generic
generic sildenafil buy generic robaxin 500mg buy generic methocarbamol
sildenafil drug order suhagra generic estradiol 1mg ca
order lamotrigine generic tretinoin without prescription order retin gel for sale
tadalis price order voltaren 50mg for sale voltaren 50mg for sale
isotretinoin 10mg cost order isotretinoin online cheap zithromax 500mg uk
order indomethacin 50mg online cheap suprax 100mg ca amoxicillin for sale online
cialis for sales cost of cialis viagra over the counter
arimidex 1mg pill buy clarithromycin 250mg generic sildenafil 100mg cheap
isotretinoin 20mg price buy stromectol 12mg pills stromectol tab price
buy doxycycline pills order furosemide 100mg pills buy generic furosemide
order ramipril 10mg without prescription order irbesartan 300mg pills order azelastine 10 ml sale
catapres for sale order clonidine for sale tiotropium bromide 9 mcg price
buspar online buy buy ditropan ditropan 5mg sale
order terazosin 1mg generic order sulfasalazine 500mg generic azulfidine cost
order fosamax 35mg without prescription generic panadol purchase famotidine pills
benicar brand divalproex 500mg ca brand diamox 250 mg
imdur online order lanoxin 2250 mg pills micardis for sale
bupropion oral buy seroquel 50mg pill oral seroquel
molnunat 200mg pills purchase naprosyn for sale prevacid buy online
cost sertraline 50mg Generic viagra canadian order viagra for sale
naltrexone 50 mg usa albendazole brand aripiprazole buy online
order avlosulfon 100 mg allegra 120mg tablet purchase aceon generic
provigil 100mg canada stromectol 6mg uk cost stromectol
buy isotretinoin 40mg online cheap isotretinoin 20mg price prednisone 5mg over the counter
order cialis 10mg without prescription cialis 5mg oral order sildenafil 100mg pills
furosemide over the counter order plaquenil 400mg sale buy hydroxychloroquine generic
buy cialis purchase clomipramine sale generic anafranil
sporanox pills progesterone over the counter oral tinidazole 300mg
purchase amlodipine cialis 5mg drug cialis for daily use
order generic sildenafil 50mg sildenafil 100 mg cheap lisinopril 5mg
purchase zyvox generic zyvox over the counter roulette online for real money
order prilosec without prescription best online casinos that payout free online slots
buy metoprolol 100mg for sale metoprolol medication levitra 20mg generic
buy levitra 10mg generic purchase lyrica online cheap methylprednisolone 4mg tablets
buy an essay online help write my paper buy sildenafil 100mg sale
clomid order oral ventolin 4mg play live poker online
cialis online canada sildenafil 50 mg viagra 50mg over the counter
oral orlistat diltiazem 180mg sale order zovirax 800mg pills
tadalafil 20mg cheap clopidogrel 75mg brand order plavix
buy allopurinol 100mg without prescription ezetimibe 10mg price ezetimibe generic
buy methotrexate 2.5mg for sale reglan drug metoclopramide cheap
buy losartan 25mg for sale generic topamax 100mg topamax without prescription
buy lioresal for sale order ozobax generic toradol 10mg us
buy imitrex 50mg online buy imitrex 25mg pills purchase avodart without prescription
order colchicine generic order colchicine 0.5mg online casino real money
ranitidine online buy buy ranitidine 150mg sale buy celecoxib 200mg
buy tamsulosin online cheap buy tamsulosin 0.2mg without prescription order generic spironolactone 100mg
cialis 40mg over the counter cipro brand ciprofloxacin usa
zocor sale buy simvastatin 20mg sale generic proscar
order flagyl 200mg pills bactrim 960mg cost bactrim 480mg uk
keflex 250mg cost erythromycin 250mg sale buy erythromycin 250mg generic
cheapest viagra sildenafil 50mg sale brand name cialis
order cefuroxime 250mg for sale buy robaxin 500mg generic methocarbamol 500mg pills
sildenafil 25mg price order sildalis generic generic lamotrigine 50mg
buy zithromax online azithromycin 500mg for sale cheap gabapentin pills
gamble poker online provigil usa modafinil 100mg us
purchase furosemide for sale buy doxycycline 100mg generic cheap hydroxychloroquine
purchase deltasone generic order deltasone 5mg generic order vermox generic
buy sildenafil 100mg generic generic sildenafil 100mg buy rhinocort online cheap