Index: phpdoc/ja/Translators
diff -u phpdoc/ja/Translators:1.21 phpdoc/ja/Translators:1.22
--- phpdoc/ja/Translators:1.21 Thu Apr 5 08:09:14 2001
+++ phpdoc/ja/Translators Sat Apr 14 03:39:45 2001
@@ -45,6 +45,7 @@
functions/dba.xml Rui Hirokawa
functions/dbase.xml Rui Hirokawa
functions/dbm.xml Michihide Hotta
+functions/dbx.xml Rui Hirokawa
functions/dir.xml Rui Hirokawa
functions/dl.xml Chihiro Higuchi
functions/domxml.xml Rui Hirokawa
Index: phpdoc/ja/functions/image.xml
diff -u phpdoc/ja/functions/image.xml:1.21 phpdoc/ja/functions/image.xml:1.22
--- phpdoc/ja/functions/image.xml:1.21 Sat Feb 3 17:05:22 2001
+++ phpdoc/ja/functions/image.xml Sat Apr 14 03:39:45 2001
@@ -118,6 +118,41 @@
+
+
+ ImageAlphaBlending
+ イメージをblendingモードに設定する
+
+
+ 説明
+
+
+ int imagealphablending
+ resource im
+ bool blendmode
+
+
+
+ ImageAlphaBlending によりTrueColorイメージに
+ 二つの異なる描画モードを使用可能となります。blendingモードでは、
+ 全ての描画関数に指定される色のalphaチャネル要素として使用され、
+ 例えばImageSetPixelでは背景色の透過割合を定
+ 義します。結果として、gd は描画色に関してその点に存在する色を自動
+ 的にブレンドし、イメージに結果を保存します。結果のピクセルは、透
+ 明になります。ブレンドモードでない場合、描画色は形式的にそのアル
+ ファチャネル情報にコピーされ、出力ピクセルを置換します。ブレンド
+ モードは、パレットイメージを描画している際には使用できません。
+ blendmode がtrueの場合、blendingモードが有
+ 効になり、そうでない場合は無効となります。
+
+
+
+ この関数は、PHP 4.0.6で追加され、GD 2.0.1を必要をします。
+
+
+
+
+
ImageArc
@@ -139,10 +174,11 @@
- ImageArcは、imで示す画像上にcx、
- cyを中心(左上が0,0)とする部分楕円を描画します。
- wとhはそれぞれ楕円の幅と
- 高さを指定します。一方、始点と終点は引数sと
+ ImageArcは、imで示す画像上に
+ cx、cyを中心(左上が
+ 0,0)とする部分楕円を描画します。wと
+ hはそれぞれ楕円の幅と高さを指定します。一
+ 方、始点と終点は引数sと
eにより度(deg)で指定します。
@@ -167,9 +203,10 @@
- ImageCharは、画像im上の
- 座標x,y(左上が0,0) に
- col色でcの最初の文字を描画します。
+ ImageCharは、画像im上
+ の座標x,y(左上が
+ 0,0) に col色でcの
+ 最初の文字を描画します。
font が、1, 2, 3, 4 , 5 の場合は組込みフォントが使用されます。
(より大きな数字はより大きなフォントに対応します)
@@ -335,6 +372,40 @@
+
+
+ ImageColorClosestAlpha
+
+ Get the index of the closest color to the specified color + alpha
+
+
+
+ 説明
+
+
+ int imagecolorclosestalpha
+ resource im
+ int red
+ int green
+ int blue
+ int alpha
+
+
+
+ Returns the index of the color in the palette of the image which
+ is "closest" to the specified RGB value and alpha level.
+
+
+ See also imagecolorexactalpha.
+
+
+
+ This function was added in PHP 4.0.6 and requires GD 2.0.1
+
+
+
+
+
ImageColorExact
@@ -360,9 +431,46 @@
imagecolorclosest も参照下さい。
-
-
+
+
+
+
+ ImageColorExactAlpha
+ Get the index of the specified color + alpha
+
+
+ 説明
+
+
+ int imagecolorexactalpha
+ resource im
+ int red
+ int green
+ int blue
+ int alpha
+
+
+
+ Returns the index of the specified color+alpha in the palette of the
+ image.
+
+
+ If the color does not exist in the image's palette, -1 is
+ returned.
+
+
+ See also imagecolorclosestalpha.
+
+
+
+ This function was added in PHP 4.0.6 and requires GD 2.0.1 or
+ later
+
+
+
+
+
ImageColorResolve
@@ -391,6 +499,164 @@
+
+
+ ImageEllipse
+ Draw an ellipse
+
+
+ 説明
+
+
+ int imageellipse
+ resource im
+ int cx
+ int cy
+ int w
+ int h
+ int col
+
+
+
+ ImageEllipse draws an ellipse centered at
+ cx, cy (top left is
+ 0, 0) in the image represented by im.
+ W and h specifies the
+ ellipse's width and height respectively. The color of the ellipse is
+ specified by color.
+
+
+
+ This function was added in PHP 4.0.6 and requires GD 2.0.2 or
+ later
+
+
+
+
+
+
+
+ ImageFilledArc
+ Draw a partial ellipse and fill it
+
+
+ 説明
+
+
+ int imagefilledarc
+ int im
+ int cx
+ int cy
+ int w
+ int h
+ int s
+ int e
+ int col
+ int style
+
+
+
+ ImageFilledArc draws a partial ellipse centered at
+ cx, cy (top left is
+ 0, 0) in the image represented by im. W
+ and h specifies the ellipse's width and
+ height respectively while the start and end points are specified
+ in degrees indicated by the s and
+ e. arguments.
+ style is a bitwise OR of the following possibilities:
+
+ IMG_ARC_PIE
+ IMG_ARC_CHORD
+ IMG_ARC_NOFILL
+ IMG_ARC_EDGED
+
+ IMG_ARC_PIE and IMG_ARC_CHORD are mutually exclusive; IMG_ARC_CHORD just
+ connects the starting and ending angles with a straight line, while
+ IMG_ARC_PIE produces a rounded edge. IMG_ARC_NOFILL indicates that the arc
+ or chord should be outlined, not filled. IMG_ARC_EDGED, used together with
+ IMG_ARC_NOFILL, indicates that the beginning and ending angles should be
+ connected to the center - this is a good way to outline (rather than fill)
+ a 'pie slice'.
+
+
+
+ This function was added in PHP 4.0.6 and requires GD 2.0.1
+
+
+
+
+
+
+
+ ImageFilledEllipse
+ Draw a filled ellipse
+
+
+ 説明
+
+
+ int imagefilledellipse
+ resource im
+ int cx
+ int cy
+ int w
+ int h
+ int col
+
+
+
+ ImageFilledEllipse draws an ellipse centered at
+ cx, cy (top left is
+ 0, 0) in the image represented by im.
+ W and h specifies the
+ ellipse's width and height respectively. The ellipse is filled using
+ color
+
+
+
+ This function was added in PHP 4.0.6 and requires GD 2.0.1 or
+ later
+
+
+
+
+
+
+
+ ImageColorResolveAlpha
+
+ Get the index of the specified color + alpha or its closest possible
+ alternative
+
+
+
+ 説明
+
+
+ int imagecolorresolvealpha
+ resource im
+ int red
+ int green
+ int blue
+ int alpha
+
+
+
+ This function is guaranteed to return a color index for a
+ requested color, either the exact color or the closest possible
+ alternative.
+
+
+ See also imagecolorclosestalpha.
+
+
+
+ This function was added in PHP 4.0.6 and requires GD 2.0.1
+
+
+
+
+
ImageGammaCorrect
@@ -586,6 +852,95 @@
+
+
+ ImageCopyMerge
+
+ Copy and merge part of an image
+
+
+
+ 説明
+
+
+ int ImageCopyMerge
+ int dst_im
+ int src_im
+ int dst_x
+ int dst_y
+ int src_x
+ int src_y
+ int src_w
+ int src_h
+ int pct
+
+
+
+ Copy a part of src_im onto
+ dst_im starting at the x,y coordinates
+ src_x, src_y with
+ a width of src_w and a height of
+ src_h. The portion defined will be copied
+ onto the x,y coordinates, dst_x and
+ dst_y.
+ The two images will be merged according to pct
+ which can range from 0 to 100. When pct = 0,
+ no action is taken, when 100 this function behaves identically
+ to ImageCopy.
+
+
+
+
+
+
+ ImageCopyMergeGray
+
+ Copy and merge part of an image with gray scale
+
+
+
+ 説明
+
+
+ int ImageCopyMergeGray
+ int dst_im
+ int src_im
+ int dst_x
+ int dst_y
+ int src_x
+ int src_y
+ int src_w
+ int src_h
+ int pct
+
+
+
+ This function is identical to ImageCopyMerge except
+ that when merging it preservese the hue of the source by converting
+ the destination pixels to gray scale before the copy operation.
+
+
+ Copy a part of src_im onto
+ dst_im starting at the x,y coordinates
+ src_x, src_y with
+ a width of src_w and a height of
+ src_h. The portion defined will be copied
+ onto the x,y coordinates, dst_x and
+ dst_y.
+ The two images will be merged according to pct
+ which can range from 0 to 100. When pct = 0,
+ no action is taken, when 100 this function behaves identically
+ to ImageCopy.
+
+
+ This function is identical to ImageCopyMerge except
+ that when merging it preservese the hue of the source by converting
+ the destination pixels to gray scale before the copy operation.
+
+ This function was added in PHP 4.0.6
+
+
+
ImageCopyResized
@@ -618,13 +973,65 @@
同一であれば)関数は領域のコピーに使うことができますが、
領域が重なったときの結果は予測できません。
+
+ ImageCopyResampledも参照下さい。
+
+
+
+ ImageCopyResampled
+ Copy and resize part of an image with resampling
+
+
+ 説明
+
+
+ int imagecopyresampled
+ resource dst_im
+ resource src_im
+ int dstX
+ int dstY
+ int srcX
+ int srcY
+ int dstW
+ int dstH
+ int srcW
+ int srcH
+
+
+
+ ImageCopyResampled copies a rectangular
+ portion of one image to another image, smoothly interpolating pixel
+ values so that, in particular, reducing the size of an image still
+ retains a great deal of clarity.
+ Dst_im is the destination image,
+ src_im is the source image identifier. If
+ the source and destination coordinates and width and heights
+ differ, appropriate stretching or shrinking of the image fragment
+ will be performed. The coordinates refer to the upper left
+ corner. This function can be used to copy regions within the
+ same image (if dst_im is the same as
+ src_im) but if the regions overlap the
+ results will be unpredictable.
+
+
+ See also ImageCopyResized.
+
+
+
+ This function was added in PHP 4.0.6 and requires GD 2.0.1 or
+ later
+
+
+
+
+
ImageCreate
- 新規画像の作成
+ パレットを使用する新規画像の作成説明
@@ -658,6 +1065,58 @@
+
+
+ ImageCreateTrueColor
+ Create a new true color image
+
+
+ 説明
+
+
+ resource imagecreatetruecolor
+ int x_size
+ int y_size
+
+
+
+ ImageCreateTrueColor returns an image identifier
+ representing a black image of size x_size
+ by y_size.
+
+ This function was added in PHP 4.0.6
+ This function requires GD 2.0.1 or later
+
+
+
+
+
+ ImageTrueColorToPalette
+ Convert a true color image to a palette image
+
+
+ 説明
+
+
+ void imagetruecolortopalette
+ resource im
+
+
+
+ ImageTrueColorToPalette converts a truecolor image
+ to a palette image. The code for this function was originally drawn from
+ the Independent JPEG Group library code, which is excellent. The code
+ has been modified to preserve as much alpha channel information as
+ possible in the resulting palette, in addition to preserving colors as
+ well as possible. This does not work as well as might be hoped. It is
+ usually best to simply produce a truecolor output image instead, which
+ guarantees the highest output quality.
+
+ This function was added in PHP 4.0.6
+ This function requires GD 2.0.1 or later
+
+
+
ImageCreateFromGif
@@ -1898,6 +2357,106 @@
imagecreateおよび
imagecolorallocateも参考にしてください。
+
+
+
+
+
+ ImageSetBrush
+ Set the brush image for line drawing
+
+
+ 説明
+
+
+ int imagesetbrush
+ resource im
+ resource brush
+
+
+
+ ImageSetBrush sets the brush image to be
+ used by all line drawing functions (such as ImageLine
+ and ImagePolygon) when drawing with the special
+ colors IMG_COLOR_BRUSHED or IMG_COLOR_STYLEDBRUSHED.
+
+
+
+ You need not take special action when you are finished with a
+ brush, but if you
+ destroy the brush image, you must not use the IMG_COLOR_BRUSHED
+ or IMG_COLOR_STYLEDBRUSHED
+ colors until you have set a new brush image!
+
+
+
+
+ この関数は、PHP 4.0.6 で追加されました。
+
+
+
+
+
+
+
+ ImageSetTile
+ Set the tile image for filling
+
+
+ 説明
+
+
+ int imagesettile
+ resource im
+ resource tile
+
+
+
+ ImageSetTile sets the tile image to be
+ used by all region filling functions (such as ImageFill
+ and ImageFilledPolygon) when filling with the special
+ color IMG_COLOR_TILED.
+
+
+ A tile is an image used to fill an area with a repeated pattern. Any
+ GD image can be used as a tile, and by setting the transparent color index of the tile
+ image with ImageColorTransparent, a tile allows certain parts
+ of the underlying area to shine through can be created.
+
+
+ You need not take special action when you are finished with a tile, but if you
+ destroy the tile image, you must not use the IMG_COLOR_TILED color until you have
+ set a new tile image!
+
+ This function was added in PHP 4.0.6
+
+
+
+
+
+ ImageSetThickness
+ Set the thickness for line drawing
+
+
+ 説明
+
+
+ void imagesetthickness
+ resource im
+ int thickness
+
+
+
+ ImageSetThickness sets the thickness of the lines
+ drawn when drawing rectangles, polygons, ellipses etc. etc. to
+ thickness pixels.
+
+
+
+ This function was added in PHP 4.0.6 and requires GD 2.0.1 or
+ later
+
+
Index: phpdoc/ja/functions/dbx.xml
+++ phpdoc/ja/functions/dbx.xml
dbx 関数dbx
dbx モジュールは、データベース抽象化レイヤ (db 'X'、ただし 'X' は
サポートされるデータベースの一つを意味します)のことです。dbx 関数
により、サポートされる全てのデータベースを単一の呼出表記によりアク
セスすることが可能になります。これらの関数を利用可能にするには、
オプションを使用し
てdbxサポートを有効にし、また、使用するデータベースに関するオプショ
ン、例えば、MySQL の場合は も指定して PHPをコンパイル
する必要があります。dbx 関数自体は、データベースへの直接のインター
フェイスを有しませんが、それらのデータベースをサポートするために使
用されるモジュールへのインターフェイスを有します。dbxモジュールで
データベースを使用可能とするには、そのモジュールが PHPにリンクされ
るかロードされる必要があり、そのデータベースのモジュールは、dbxモ
ジュールにサポートされている必要があります。現在、MySQL、
PostgreSQL、ODBCがサポートされており、その他についても(希望的観測
だとまもなく)追加される予定です。
dbx にデータベースのサポートを追加するためのドキュメントは、
&url.dbx.docs; にあります。
dbx_closeオープンされた接続/データベースを閉じる説明boolean dbx_closedbx_link_object
link_identifier
成功時にTRUE、エラーの際に
FALSEを返します。
dbx_close の例
<?php
$link = dbx_connect ("mysql", "localhost", "db", "username", "password")
or die ("Could not connect");
print("Connected successfully");
dbx_close($link);
?>
モジュール毎のドキュメントも参照下さい。
dbx_connectも参照下さい。
dbx_connect接続/データベースをオープンする説明dbx_link_object dbx_connectstring modulestring hoststring databasestring usernamestring passwordint
persistent
返り値: 成功時にdbx_link_object、エラー時に
FALSE。接続が確立されたが、データベースが選択
できない場合でも、この関数は dbx_link_object を返します。パラメー
タpersistentにDBX_PERSISTENTを設定すること
ができ、この場合には、持続的接続が作成されます。
使用可能なモジュール名を以下に示します。ただし、モジュールが実際
にロードされている場合にのみ動作することに注意して下さい。
モジュール 1: "mysql"
モジュール 2: "odbc"
モジュール 3: "pgsql"
pgsql サポートは、まだ実験的であり、ソースファイルの一つを自分で
修正した後で pgsql モジュールをコンパイルする必要があります。修正
を行わないとクエリ毎に PostgreSQLの警告が発生してしまいます。
dbx_link_object は、3つのメンバ 'handle'、'module'、'database' を
有します。メンバ 'database'は、現在選択されているデータベースの名
前です。メンバ'module'は、dbxの内部のみで使用され、上記の有効なモ
ジュール番号です。メンバ 'handle' は、データベース接続に関する有
効なハンドルで、(必要に応じて)モジュール専用関数で使用されます。
例えば、
<?php
$link = dbx_connect ("mysql", "localhost", "db", "username", "password");
mysql_close ($link->handle); // dbx_close($link) の方が良いかもしれません
?>
パラメータhost、database、username、passwordが必要ですが、常に抽
象化モジュールで使用されるわけではありません。
dbx_connect の例
<?php
$link = dbx_connect ("odbc", "", "db", "username", "password", DBX_PERSISTENT)
or die ("接続できません");
print ("接続に成功しました");
dbx_close ($link);
?>
モジュール毎のドキュメントも参照下さい。
dbx_closeも参照下さい。
dbx_error
(接続時だけでなく)使用するモジュールの最新の関数コールにおけるエ
ラーメッセージを出力する
説明string dbx_errordbx_link_object link_identifier
モジュール(例えば mysql-module)の直近の関数コールからエラーメッセー
ジを有する文字列を返します。同じモジュールに複数の接続がある場合、
最後のエラーのみが取得されます。別のモジュールに接続がある場合、
(リンクパラメータで)指定したモジュールに関する直近のエラーのみが
返されます。ODBCモジュールは現在エラー出力関数をサポートしていな
いことに注意して下さい。
dbx_errorの例
<?php
$link = dbx_connect ("mysql", "localhost", "db", "username", "password")
or die ("接続できません");
$result = dbx_query ($link, "select id from nonexistingtbl");
if ($result==0) {
echo dbx_error ($link);
}
dbx_close ($link);
?>
モジュール毎のドキュメントも参照下さい。
dbx_queryクエリを送信し、(ある場合には)結果を全て取得する説明dbx_result_object dbx_querydbx_link_object
link_identifierstring sql_statementlong
flags
成功時にdbx_result_objectまたは1を返します。結果オブジェクトは、
SQL命令が結果を返す場合にのみ返されます。エラーの場合には、0を返
します。パラメータ flags は、返される情報
の量を制御するために使用されます。定数 DBX_RESULT_INFO,
DBX_RESULT_INDEX, DBX_RESULT_ASSOC またはこれらの論理和を組み合わ
せることが可能です。DBX_RESULT_INFO を指定するとフィールド名およ
びフィールド型のようなカラムに関する情報が提供されます。
DBX_RESULT_INDEX により、結果は(data[2][3]のような、ただし、2はレ
コード番号、3はカラム番号)2次元の配列で返されます。ただし、最初の
レコードおよびカラム番号は0から始まります。
DBX_RESULT_ASSOC により、フィールド名にカラム添字が関連付けられま
す。パラメータflags によらず
DBX_RESULT_INDEXは常に返されることに注意して下さい。
DBX_RESULT_ASSOC が指定された場合、DBX_RESULT_INFOは指定されない
場合でも返されます。これは、DBX_RESULT_INDEX,DBX_RESULT_INDEX |
DBX_RESULT_INFO および DBX_RESULT_INDEX | DBX_RESULT_INFO |
DBX_RESULT_ASSOC の組み合わせのみが結果的に使用可能であることを意
味します。 flags が指定されない場合、この
最後の組み合わせがデフォルトです。連想配列で参照される結果は、添
字番号の結果へのリファレンスです。このため、
data[0][0] を修正した場合、
data[0]['fieldnameforfirstcolumn'] も同時に修
正されます。
dbx_result_object には、5つのメンバがあります。
(flagsによっては4つの場合もあります)これら
は、'handle', 'cols', 'rows', 'info'(オプション), 'data'です。
handle は、指定したモジュールに関する有効な結果IDであり、次のよう
にモジュール専用関数で使用可能です。
$result = dbx_query ($link, "SELECT id FROM tbl");
mysql_field_len ($result->handle, 0);
メンバ cols および rows は、それぞれカラム(またはフィールド)番号
および行(またはレコード)番号です。例えば、
$result = dbx_query ($link, "SELECT id FROM tbl");
echo "結果のサイズ: " . $result->rows . " x " . $result->cols . "<br>\n";
メンバinfoは、DBX_RESULT_INFOまたはDBX_RESULT_ASSOCが
flagsパラメータで指定された場合のみ返され
ます。このメンバは2次元配列で、カラム情報を取得するために二つのレ
コード("name"と"type")を有しています。例えば、
$result = dbx_query ($link, "SELECT id FROM tbl");
echo "カラム名: " . $result->info["name"][0] . "<br>\n";
echo "カラム型: " . $result->info["type"][0] . "<br>\n";
メンバdataには、実際の結果が含まれます。そして、カラム名も同様に
関連しています。DBX_RESULT_ASSOCが設定された場合、
$result->data[2]["fieldname"]を使用することが
可能です。
dbx_query の例
<?php
$link = dbx_connect ("odbc", "", "db", "username", "password")
or die ("接続できません");
$result = dbx_query ($link, "SELECT id, parentid, description FROM tbl");
if ($result==0) echo "クエリに失敗しました\n<br>";
elseif ($result==1) {
echo "クエリの実行に成功しました\n<br>";
} else {
$rows=$result->rows;
$cols=$result->cols;
echo "<p>テーブル次元: {$result->rows} x {$result->cols}<br><table border=1>\n";
echo "<tr>";
for ($col=0; $col<$cols; ++$col) {
echo "<td>-{$result->info["name"][$col]}-<br>-{$result->info["type"][$col]}-</td>";
}
echo "</tr>\n";
for ($row=0; $row<$rows; ++$row){
echo "<tr>";
for ($col=0; $col<$cols; ++$col) {
echo "<td>-{$result->data[$row][$col]}-</td>";
}
echo "</tr>\n";
}
echo "</table><p>\n";
echo "テーブル次元: {$result->rows} x id, parentid, description<br><table border=1>\n";
for ($row=0; $row<$rows; ++$row) {
echo "<tr>";
echo "<td>-{$result->data[$row]["id"]}-</td>";
echo "<td>-{$result->data[$row]["parentid"]}-</td>";
echo "<td>-{$result->data[$row]["description"]}-</td>";
echo "</tr>\n";
}
echo "</table><p>\n";
}
dbx_close($link);
?>
モジュール毎のドキュメントも参照下さい。
dbx_connectも参照下さい。
dbx_sort
カスタマイズされたsort関数により、dbx_queryから結果をソートする
説明boolean dbx_sortdbx_result_object resultstring
user_compare_function
成功時にTRUE、エラー時に
FALSEを返します。
dbx_sortの例
<?php
function user_re_order ($a, $b) {
$rv = dbx_cmp_asc ($a, $b, "parentid");
if (!$rv) $rv = dbx_cmp_asc ($a, $b, "id");
return $rv;
}
$link = dbx_connect ("odbc", "", "db", "username", "password")
or die ("接続できません");
$result = dbx_query ($link, "SELECT id, parentid, description FROM tbl ORDER BY id");
echo "結果は、idでソートされています<br>";
dbx_query ($result, "user_re_order");
echo "結果はparentidでソートされ、続いて、idでソートされます<br>";
dbx_close ($link);
?>
dbx_cmp_asc および
dbx_cmp_desc も参照下さい。
dbx_cmp_asc
昇順にソートするために二つのレコードを比較する
説明int dbx_cmp_ascarray row_aarray row_bstring columnname_or_index
row_a[$columnname_or_index] が row_b[$columnname_or_index] に等し
い場合に 0、より大きい場合に 1、より小さい場合に -1 を返します。
dbx_cmp_ascの例
<?php
function user_re_order ($a, $b) {
$rv = dbx_cmp_asc ($a, $b, "parentid");
if (!$rv) {
$rv = dbx_cmp_asc ($a, $b, "id");
return $rv;
}
}
$link = dbx_connect ("odbc", "", "db", "username", "password")
or die ("接続できません");
$result = dbx_query ($link, "SELECT id, parentid, description FROM tbl ORDER BY id");
echo "結果はidでソートされました<br>";
dbx_query ($result, "user_re_order");
echo "結果はparentidそしてidでソートされました<br>";
dbx_close ($link);
?>
dbx_sortおよび
dbx_cmp_descも参照下さい。
dbx_cmp_desc
降順にソートするために二つのレコードを比較する
説明int dbx_cmp_descarray row_aarray row_bstring
columnname_or_index
row_a[$columnname_or_index] が row_b[$columnname_or_index] に等し
い場合に 0、より大きい場合に-1、より小さい場合に1を返します。
dbx_cmp_descの例
<?php
function user_re_order ($a, $b) {
$rv = dbx_cmp_asc ($a, $b, "parentid");
if (!$rv) {
$rv = dbx_cmp_asc($a, $b, "id");
return $rv;
}
}
$link = dbx_connect ("odbc", "", "db", "username", "password")
or die ("接続できません");
$result = dbx_query ($link, "SELECT id, parentid, description FROM tbl ORDER BY id");
echo "結果はidでソートされました<br>";
dbx_query ($result, "user_re_order");
echo "結果はparentidそしてidでソートされました<br>";
dbx_close ($link);
?>
dbx_sortおよび
dbx_cmp_ascも参照下さい。