Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: http_build_url - Manual
[go: Go Back, main page]

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

search for in the

Hyperwave 関数" width="11" height="7"/> <http_build_str
Last updated: Mon, 05 Feb 2007

view this page in

http_build_url

(No version information available, might be only in CVS)

http_build_url — URL を組み立てる

説明

string http_build_url ( [mixed url [, mixed parts [, int flags = HTTP_URL_REPLACE [, array &new_url]]]] )

URL を組み立てます。

引数 flag の設定によっては、二番目の URL の一部が最初の URL に統合されます。

パラメータ

url

文字列形式、あるいは parse_url() の返すような連想配列形式で表した、URL (の一部)。

parts

最初の引数と同じ。

flags

HTTP_URL 定数 の論理和からなるビットマスク。デフォルトは HTTP_URL_REPLACE です。

new_url

設定されている場合は、parse_url() が返すような構築された URL の一部が格納されます。

返り値

成功した場合に新しい URL を表す文字列、失敗した場合に FALSE を返します。

例 828. http_build_url() の例

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

上の例の出力は以下となります。


ftp://ftp.example.com/pub/files/current/?a=b&a=c

    



add a note add a note User Contributed Notes
http_build_url
There are no user contributed notes for this page.

Hyperwave 関数" width="11" height="7"/> <http_build_str
Last updated: Mon, 05 Feb 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites