Re: which function can do so ?
| From: | Richard Lynch | Date: | Mon, 05 Aug 2002 07:08:36 +0000 |
| Subject: | Re: which function can do so ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111171@lists.php.net to get a copy of this message | ||
>I am exactly a beginner of php. This question may be easy.
>I have a php program which want to achieve the url from browser.
>e.g. webmail.xxx.com
>
>then how the index.php is able to know it is xxx.com ??
>which function in php can do so??
Depends...
What if it's:
chi.mail.ameritech.net
Did you want 'mail.ameritech.net' or 'ameritech.net' ?
Well, it's pretty much the same either way.
<?php
$url = 'webmail.xxx.com';
$parts = explode('.', $url);
$lasttwo = $parts[count($parts) - 2] . '.' . $parts[count($parts) - 1];
unset($parts[0]);
$allbutfirst = implode('.', $parts);
?>
--
Like Music? http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro). Need to record live events (mixed already) to stereo
CD-quality. Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff. Zero (0)
post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.