Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Closed Thread
Parse a URL in PHP to Return Domain
Old 11-02-2004, 05:12 AM Parse a URL in PHP to Return Domain
PolurNET's Avatar
Average Talker

Posts: 20
Trades: 0
Hi all,

I was requested by someone from another forum to code a script that can efficiently and effortlessly return a domain name & extension, given any type of URL (including ccTLDs as .co.uk, etc.) Well it turned out harder than said, so thought I should share the code I developed with this community

Enjoy & comments are appreciated!

==================

Quote:
Here is the Version 3.01 Final, 100% working, and newest full-featured version of this script. :talk: :]

Now, it's protected by the free GNU Public License, so please respect the property rights and leave the credits.
Info:
PHP Code:
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ---  FIND DOMAIN NAME (HOSTNAME) GIVEN ANY TYPE OF URL OR TLD EXTENSION (v3.01)  ---
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//                    --  VERSION 3.01 Final  --
**NOTEThe below comments may be removed in your scriptAbove must remain intact.
------------------
Changes/Fixes  |
------------------
Added auto removal of 'www' if present
Added ANY TLD routine ... CountryCode TLDs workexco.ukany.tld.ext
Added subdomain function ... manual recognition
Integrated all routines in function... only end-user input is isolated
Fixed SERVER variablesin which "host" is undefinedonly "path" array holds
Fixed case insenstivity mode
Improved Execution of Code via Regular Expressions
*/ 
Package Attached to this post. If ever you run into problems, have suggestions, feature improvements or bug reports, simply email me at info@polurnet.com OR PM here, OR post here
Attached Files
File Type: zip DomainFind v3.01.zip (8.5 KB, 138 views)
__________________
••Visit the InfoResourceNetwork
Please login or register to view this content. Registration is FREE
::history::science::math::geo::essays::& more!••
••
Please login or register to view this content. Registration is FREE

==Avoid the freeze and enjoy the breeze with PolurNET Hosting™==
PolurNET is offline
View Public Profile Visit PolurNET's homepage!
 
 
Register now for full access!
Old 11-02-2004, 06:41 PM
PolurNET's Avatar
Average Talker

Posts: 20
Trades: 0
well if anyone finds it useful or have comments, I'd appreciate a post

Thanks
Anand
__________________
••Visit the InfoResourceNetwork
Please login or register to view this content. Registration is FREE
::history::science::math::geo::essays::& more!••
••
Please login or register to view this content. Registration is FREE

==Avoid the freeze and enjoy the breeze with PolurNET Hosting™==
PolurNET is offline
View Public Profile Visit PolurNET's homepage!
 
Old 07-23-2009, 08:36 AM Re: Parse a URL in PHP to Return Domain
Banned

Posts: 3
Name: Jane Ally
Trades: 0
thanks a lot
but I have to write a second function to get the subdomain as well
but yours will help a lot
hagsish is offline
View Public Profile
 
Old 07-23-2009, 10:23 AM Re: Parse a URL in PHP to Return Domain
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
ah, not interested, but thanks anyway
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
View Public Profile
 
Closed Thread     « Reply to Parse a URL in PHP to Return Domain
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.43857 seconds with 13 queries