Quick question...
I parse domains in my scripts like this to get the .domain.com out of www.domain.com.
However, if someone visits my site with just domain.com in the url, I get .com back as
the parsed domain. How can I make it so I aways get the .domain.com no matter what
they use?
Here is
Hi,
Thursday, August 28, 2003, 6:30:44 PM, you wrote:
CcM Quick question...
CcM I parse domains in my scripts like this to get the .domain.com out of
www.domain.com. However, if someone visits my site with just domain.com in the url, I
get .com back as the parsed domain.
CcM How can I make it
str_replace('/www.','/',$parseddomain);
wont this just make me get a .com when I use my thing to parse the domain?
--
___
Get your free Verizonmail at www.verizonmail.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
So why does college suck? Afraid of learning?
Anyway, you can solve your problem by simple parsing. An example is below.
?php
$TheParse = www.edmondpaper.com;
$TheNewParse = explode (., $TheParse);
$TheTotal = count($TheNewParse);
echo ($TheNewParse[($TheTotal - 2)]);
echo (.);
echo
So why does college suck? Afraid of learning?
Feel free to ask me off the list and I'll explain why I started the site.
Thanks for the code. Anyway way of making it one line and with the leading .?
J.
--
___
Get your free Verizonmail at
Hi,
Thursday, August 28, 2003, 7:02:44 PM, you wrote:
str_replace('/www.','/',$parseddomain);
MJ wont this just make me get a .com when I use my thing to parse the domain?
MJ --
MJ ___
MJ Get your free Verizonmail at www.verizonmail.com
No it
No it should just get rid of the www so your left
with domain.com and now that I see what you are
after it should have been:
I don't aways use www.domain.com. Sometimes I use test.domain.com. I have about 14k of
these pointing to the same script. Otherwise I would just remove the www -lol.
Mike --
...and then CollegeSucks.com Mike said...
%
% Quick question...
Quick answer :-)
%
...
%
% $parseddomain = preg_replace('/.+?(\..+)/', '$1', $domain);
# pulls out domain from
# domain.com
# www.domain.com
# www.domain.ac.uk
# ...
$this_domain =
8 matches
Mail list logo