Hi
On Wed, 15 Oct 2008 09:03:10 -0700, bgold12 wrote:
Quote:
Hey, I know that in a URL there's generally the "scheme" (i.e.
http://),
followed by the hostname or domain name (i.e. en.wikipedia.org/)
followed by possible subfolders (i.e. /wiki/) which can then be followed
by the name of a file to send the request to (i.e. index.html or
index.php or something). There can also be GET data (i.e. ? name=value)
and the anchor thing (i.e. #Chapter_1). But also, frequently there's
just a string that finishes the URL, which doesn't appear to be a folder
(no trailing forward slash) or a file (no extension), for example:
>
http://en.wikipedia.org/wiki/Uniform_Resource_Locator 1) Files do not have to have have "extensions" on modern systems.
2) Web addresses do not have to refer to files.
http://example.org/fooo...barrr
is a valid URL even on some systems where foo...bar is not a valid
filename.
Moreover the part after the third slash and before the final slash does
not have to refer to a directory, although if relative URLs contain ../
then it they are treated as if it does.
PS: you duplicated the third slash - it is not part of the domain.
Quote:
and how you can use php to get it?
There are all sorts of ways to open a remote resource in php. IIRC you
can just do:
$foo= file( 'http://en.wikipedia.org/wiki/Uniform_Resource_Locator' );
HTH
viza