downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Hyperwave> <http_build_str
[edit] Last updated: Fri, 23 Mar 2012

view this page in

http_build_url

(PECL pecl_http >= 0.21.0)

http_build_urlBir URL derler

Açıklama

string http_build_url ([ mixed $url [, mixed $parçalar [, int $seçenekler = HTTP_URL_REPLACE [, array &$yeni_url ]]]] )

Bir URL derler.

seçenekler değiştirgesine bağlı olarak ikinci URL parçası birinciye katıştırılır.

Değiştirgeler

url

Bir URL, bir dizge biçiminde olabileceği gibi parse_url() işlevinin döndürdüğü şekilde bir ilişkisel dizi de olabilir.

parçalar

Bir URL'nin parçaları, bir dizge biçiminde olabileceği gibi parse_url() işlevinin döndürdüğü şekilde bir ilişkisel dizi de olabilir.

seçenekler

HTTP_URL sabitlerinin bit seviyesinde VEYAlanmış bitmaskı; HTTP_URL_REPLACE öntanımlıdır.

yeni_url

Belirtilirse, parse_url() işlevinin döndürdüğü biçimde oluşturulmuş URL parçaları ile doldurulur.

Dönen Değerler

Başarı durumunda yeni URL bir dizge olarak döndürülür, aksi takdirde FALSE döner.

Örnekler

Örnek 1 - http_build_url() örneği

<?php
echo http_build_url("http://user@gen.tr/pub/index.php?a=b#files",
    array(
        
"scheme" => "ftp",
        
"host" => "ftp.gen.tr",
        
"path" => "files/current/",
        
"query" => "a=c"
    
),
    
HTTP_URL_STRIP_AUTH HTTP_URL_JOIN_PATH HTTP_URL_JOIN_QUERY HTTP_URL_STRIP_FRAGMENT
);
?>

Yukarıdaki örneğin çıktısı:

ftp://ftp.gen.tr/pub/files/current/?a=b&a=c

Ayrıca Bakınız



Hyperwave> <http_build_str
[edit] Last updated: Fri, 23 Mar 2012
 
add a note add a note User Contributed Notes http_build_url
randyg at ernieball dot com 06-Feb-2012 08:15
Although I've never used this function, based on the documentation it seems that the above code should also include the following:

<?php
   
if ( ! is_array( $url ) ) // Added - Randy
    // Parse the original URL
       
$parse_url = parse_url($url);
       
// allow parts to be a url Added - Randy
   
if ( ! is_array( $parts ) )
       
$parts = parse_url( $parts );
?>
Ant P. 09-Jun-2010 09:58
This function has a useful undocumented feature - the defaults are set in such a way that calling it with no parameters returns the full URL of the page being accessed.
tycoonmaster at gmail dot com 20-Feb-2010 11:55
If you are looking for a PHP Version of this function, follow the link below:

http://www.mediafire.com/?zjry3tynkg5

Note: I would have added the function here, but I just couldn't get it past the line restrictions without making it impossible to read.

Enjoy.

 
show source | credits | sitemap | contact | advertising | mirror sites