П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
Поиск по сайту:
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое








Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 5433 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 7788 раз(а).

Учебник HTML.
Просмотров 4558 раз(а).

Руководство по PHP5.
Просмотров 1104 раз(а).

Хостинг через призму DNS.
Просмотров 6314 раз(а).

Подборка текстов стандартных документов.
Просмотров 57169 раз(а).

Учебник PHP - Самоучитель
Просмотров 4757 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 10761 раз(а).

Внешние атаки...
Просмотров 6342 раз(а).

Учебник PHP.
Просмотров 3899 раз(а).

SSI в примерах.
Просмотров 917 раз(а).



 
 
| Добавить в избранное | Сделать стартовой | Помощь





Руководство по PHP
Пред. След.

parse_url

(PHP 3, PHP 4, PHP 5)

parse_url -- Parse a URL and return its components

Описание

array parse_url ( string url )

This function parses a URL and returns an associative array containing any of the various components of the URL that are present.

This function is not meant to validate the given URL, it only breaks it up into the above listed parts. Partial URLs are also accepted, parse_url() tries its best to parse them correctly.

Список параметров

url

The URL to parse

Возвращаемые значения

On seriously malformed URLs, parse_url() may return FALSE and emit a E_WARNING. Otherwise an associative array is returned, whose components may be (at least one):

  • scheme - e.g. http

  • host

  • port

  • user

  • pass

  • path

  • query - after the question mark ?

  • fragment - after the hashmark #

Примеры

Пример 1. A parse_url() example

<?php
$url
= 'http://username:password@hostname/path?arg=value#anchor';

print_r(parse_url($url));
?>

Результат выполнения данного примера:

Array
(
[scheme] => http
[host] => hostname
[user] => username
[pass] => password
[path] => /path
[query] => arg=value
[fragment] => anchor
)

Примечания

Замечание: This function doesn't work with relative URLs.

Замечание: parse_url() is intended specifically for the purpose of parsing URLs and not URIs. However, to comply with PHP's backwards compatibility requirements it makes an exception for the file:// scheme where tripple slashes (file:///...) are allowed. For any other scheme this is invalid.

Смотрите также

pathinfo()
parse_str()
dirname()
basename()



Если Вы не нашли что искали, то рекомендую воспользоваться поиском по сайту:
 





Copyright © 2005-2016 Project.Net.Ru