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

search for in the

關於用戶註解> <Tips
Last updated: Sun, 25 Nov 2007

view this page in

關於本手冊

Table of Contents

手冊的格式

《PHP 參考手冊》提供了多種不同格式的版本,它們可以分為兩組:線上閱讀版本和可下載套件。

Note: 有些出版商可能已經出版了本手冊的一些印刷版本,但我們不推薦您使用它們,因為 PHP 參考手冊更新得非常快,這些印刷版本將很快失去時效性。

您可以閱讀 » PHP.net 網站 及其眾多的鏡像站點來線上閱讀《PHP 參考手冊》。為了保證最佳的閱讀速度,您應該選擇離您的地理位置最接近的鏡像站點。線上閱讀版本目前有兩種CSS樣式表,適合線上閱讀以及適合印出的兩種樣式。

和絕大多數離線格式的手冊相比,在線閱讀版本有一個很大的優點,即它集合了用戶註解» URL 捷徑 ,可以快速獲得手冊中需要的部分;同時,它的明顯的缺點是您必須保持一直線上閱讀。

目前,《PHP 參考手冊》提供多種離線閱讀格式,最適合於您的格式取決於您使用的作業系統和您個人的閱讀習慣。關於《PHP 參考手冊》如何被製作成如此多的版本,請查閱本附錄中“如何生成手冊的各種格式”一節。

跨平臺性最好的格式是 HTML 格式和純文本格式。HTML 格式提供了兩種方式:一種只有一個很大的 HTML 文件;另一種方式是每一節分成一個獨立文件,它們形成一個包含幾千個文件的包裝。我們用壓縮的格式提供這些版本,所以為了要能取得壓縮檔中的文件,解壓縮工具是必需的。

對於 Windows 平臺,我們利用了 Windows HTML Help 應用程序結合本手冊的 HTML 格式,形成了本手冊的 Windows HTML Help 版本。此版本提供手冊的全文檢索、完整的索引以及書簽功能。很多 Windows 平臺下流行的 PHP 開發環境也包括了此版本的手冊,以給開發者提供最方便快捷的參考。Linux桌面下的 CHM 閱讀程式請參考 » xCHM» GnoCHM

此外也有提供 » 延伸 CHM 版本,這個版本較少更新但提供很多額外的功能。這個技術是用來建立Help文件,雖然這只能在Microsoft Windows平台運作。



add a note add a note User Contributed Notes
關於本手冊
kulakov74 at yandex dot ru
21-Aug-2007 11:38
I improved the script php_manual_prefs.js provided with the extended chm-version to better hilight user comments and code samples as I found those in the original version too dull (gray). Note that this all cannot be done using stylesheets only as the code samples in the chm-docs do not have any distinct classes etc and can only be parsed with a script. What I added to the original script follows. The timeouts are used because the page is not loaded right at once so we have to wait for complete loading. The colors (aColorMap) can be customized. This also improves navigation links positioning in short pages, so instead of directly following contents they are now bottom-aligned. This fix needs some extra styles so they follow the code, along with some general styles.

setTimeout("AddStyles(); window.focus();", 50);

//-----------

var D, TimerId, oNav, oPage;

function AddStyles(){
D=document; ChangeExamples(); ChangeNotes();
}

function ChangeExamples(){
var aDivs, DivNo, oDiv, aSpans, SpanNo, oSpan, aColorMap, Color, aCodes;

aColorMap=[];
aColorMap['#007700']='yellow';
aColorMap['#0000bb']='white';
aColorMap['#dd0000']='yellow';
aColorMap['#ff8000']='Aqua';
//aColorMap['']='';

//Scan examples
aDivs=D.getElementsByTagName('DIV');
for(DivNo=0; DivNo<aDivs.length; DivNo++){
    oDiv=aDivs[DivNo];
    if (oDiv.className!='examplecode') continue;
    //Change colors
    oDiv.style.backgroundColor='black';
    oDiv.style.backgroundImage='none';
    //oDiv.style.color='white';

    aSpans=oDiv.getElementsByTagName('SPAN');
    for(SpanNo=0; SpanNo<aSpans.length; SpanNo++){
        oSpan=aSpans[SpanNo];
        Color=oSpan.style.color;
        oSpan.style.color=aColorMap[Color];
        if (Color=='#dd0000') oSpan.style.backgroundColor='DarkRed';
        oSpan.style.fontFamily='Lucida Console';
        }
    aCodes=oDiv.getElementsByTagName('CODE');
    for(SpanNo=0; SpanNo<aCodes.length; SpanNo++){
        oSpan=aCodes[SpanNo];
        oSpan.style.color='yellow';
        oSpan.style.fontFamily='Lucida Console';
        }
    }
}

function ChangeNotes(){
var oNotes, oDiv, aDivs, DivNo, oP, aPs;

oNotes=D.getElementById('pageNotes');
if (!oNotes){
    setTimeout('ChangeNotes();', 100); return;
    }
aDivs=oNotes.getElementsByTagName('DIV');
for(DivNo=0; DivNo<aDivs.length; DivNo++){
    oDiv=aDivs[DivNo];
    aPs=oDiv.getElementsByTagName('P');
    oP=aPs[0];
    oP.style.backgroundColor='DarkGreen';
    oP.style.color='yellow';
    oP.style.marginBottom='0px';
    oP=aPs[1];
    oP.style.backgroundColor='LightYellow';
    oP.firstChild.style.fontFamily='Lucida Console';
    //oP.firstChild.style.fontSize='12px';
    oP.style.border='1px solid DarkGreen';
    oP.style.borderTopWidth='0px';
    }

//return;
oNav=D.getElementById('pageNav');
oPage=D.getElementById('pageContent');
AlignNav(); window.onresize=AlignNav;
}

function AlignNav(){
var Pos, NavBottom, Diff;

Pos=AbsPos(oNav);
NavBottom=Pos[1]+oNav.offsetHeight;
Diff=oPage.offsetHeight-NavBottom;
if (Diff!=0) oNav.style.top=(Diff+oNav.style.posTop)+'px';
}

function AbsPos(O, Parent){
var X=0, Y=0, Next;

Next=O; if (Parent==null) Parent=D;
while (Next!=null && Next!==Parent){
    Y+=Next.offsetTop; X+=Next.offsetLeft; Next=Next.offsetParent;
    }
return [X, Y];
}

//----------
This is to be added in style.css:

Body{
    font-family: Verdana;
    font-size: 80%;
    height: 100%;
}

P{
    text-align:justify;
}

#pageContent{
    height: 100%;
}

#pageNav {
    position:relative;
}

.literal{
    background-color: LightCyan;
}

TR.question TD{
    background:LightYellow;
}

TR.answer TD{
    background:#F0FFF0;
}

關於用戶註解> <Tips
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites