时间: 2021-07-31 作者:daque
-------------------------------------------------------------------------------- 阿帕契伺服器专用函式库 -------------------------------------------------------------------------------- 本函式库公有 4 个函式望文生义,若 web 伺服器不是运用 apache 伺服器,则本函式库就派不上用途了。 apache_lookup_uri: 赢得一切的 uri 关系资源讯息。 apache_note: 赢得及设定阿帕契伺服器的乞求记录。 getallheaders: 赢得一切 http 变数值。 virtual: 实行阿帕契伺服器的子乞求 (sub-request)。 -------------------------------------------------------------------------------- 函式:apache_lookup_uri() --------------------------------------------------------------------------------apache_lookup_uri赢得一切的 uri 关系资源讯息。语法: class apache_lookup_uri(string filename);传回值: 类型函式品种: php 体例功效 实质证明 这个函式将 uri 的关系消息传回到类型变数中。传回的类型变数囊括下列的属性:statusthe_requeststatus_linemethodcontent_typehandlerurifilenamepath_infoargsboundaryno_cacheno_local_copyallowedsend_bodyctbytes_sentbyterangeclengthunparsed_urimtimerequest_time-------------------------------------------------------------------------------- 函式:apache_note() -------------------------------------------------------------------------------- apache_note赢得及设定阿帕契伺服器的乞求记录。语法: string apache_note(string note_name, string [note_value]);传回值: 字串函式品种: php 体例功效 实质证明 这个阿帕契伺服器私有的函式能设定及博得乞求记录表的值。若只代入一个参数,则传回暂时记录的 note_name 值。若代入二个参数,则传回先前的 note_name 值,并将 note_name 设为新的 note_value 值。 -------------------------------------------------------------------------------- 函式:getallheaders() --------------------------------------------------------------------------------getallheaders赢得一切 http 变数值。语法: array getallheaders(void);传回值: 阵列函式品种: php 体例功效 实质证明 运用内项功效时不需代入任何参数值,传回的是一切 http 变数值,并运用拉拢的阵传记回。 运用典型 下例列出一切的 http 变数$headers = getallheaders();while (list($header, $value) = each($headers)) { echo "$header: $value\n";}?>备注: 这个函式惟有 php 以阿帕契伺服器的模组 (module) 办法实行时方灵验。 -------------------------------------------------------------------------------- 函式:virtual() -------------------------------------------------------------------------------- virtual实行阿帕契伺服器的子乞求 (sub-request)。语法: int virtual(string filename);传回值: 平头函式品种: php 体例功效 实质证明 这个函式就即是运用伺服器端领会 (ssi) 的 shtml 功效。犯得着提防的是 virtual 所引入的程式必需要爆发灵验的 http 档头,最少要介入 content-type 档头、大概是 location 档头、大概 status 档头。而且按照 http 协议,在档头中断后尚必需空一条龙。在 php 的程式实作时,可运用 include() 或 require() 这二个函式。