Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in PHP only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
PHP
Sub Domain
Sub Domain
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
kishor7410
New Member
Join Date:
Mar 2007
Posts:
4
#1
Sub Domain
Mar 31 '07, 06:26 AM
I have an URL like: www.mail.yahoo. com.
But I want to show this URL: www.username.ma il.yahoo.com
devsusen
New Member
Join Date:
Feb 2007
Posts:
136
#2
Mar 31 '07, 11:15 AM
Originally posted by
kishor7410
I have an URL like: www.mail.yahoo. com.
But I want to show this URL: www.username.ma il.yahoo.com
should it be username.mail.y ahoo.com ?
Comment
Post
Cancel
kishor7410
New Member
Join Date:
Mar 2007
Posts:
4
#3
Apr 2 '07, 03:54 AM
Originally posted by
devsusen
should it be username.mail.y ahoo.com ?
Yes. What can I do now. Plz help.
Kishor Kumar
Comment
Post
Cancel
yumi ice
New Member
Join Date:
Apr 2007
Posts:
2
#4
Apr 3 '07, 09:50 AM
Originally posted by
kishor7410
Yes. What can I do now. Plz help.
Kishor Kumar
Hi,
maybe you can try this (extracted from http://www.php.net/manual/en/function.preg-match.php)
<?php
// get host name from URL
preg_match('@^( ?:http://)?([^/]+)@i',
"http://www.php.net/index.html", $matches);
$host = $matches[1];
// get last two segments of host name
preg_match('/[^.]+\.[^.]+$/', $host, $matches);
echo "domain name is: {$matches[0]}\n";
?>
The above example will output:
domain name is: php.net
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment