text
stringlengths
1
254
output
stringlengths
2
255
Array ([0] = XL [1] = gold)
例 1 array_values() の例
Example 2.
注意 この関数は、PHP 4.0で追加されました。以下の実装はPHP 3でも 使用することが可能です。
function array_values ($arr) {$t = array(); while (list($k, $v) = each ($arr)) {$t[] = $v;} return $t;}
例 2 PHP 3ユーザ用の array_values() の実装
Prev
array_keys() も参照下さい。
(PHP 3 = 3.0.3, PHP 4)
(PHP 3 = 3.0.3, PHP 4)
These warnings may be suppressed by prepending the PHP error operator @ to the array_walk() call, or by using error_reporting().
注意 関数名の代わりに、オブジェクトへのリファレンスを格納した配列とメソッド名を指定することも出来ます。
Then, any changes made to those elements will be made in the original array itself.
func が2つまたは3つを超える引数を必要とする場合、 userdata の指定によっては、 array_walk() が func をコールする度に警告が生成されます。これらの警告は、 array_walk() の前に'@'マークを付けるか error_reporting() を使用することにより 抑制されます。
Passing the key and userdata to function was added in 4.0.0
注意 func により配列の値そのものを変更する必要 がある場合、 func の最初の引数は参照として 渡す必要があります。この場合、配列の要素に加えた変更は、配列自体 に対して行われます。
To reset the pointer, use reset().
func の中から配列を修正すると予測できない 動作を引き起こす可能性があります。
If the array that array_walk() is applied to is changed, the behavior of this function is undefined, and unpredictable.
注意 キー及びuserdataを func に渡す処理は、 バージョン4.0で追加されました。
Example 1. array_walk() example
PHP 4では、 array_walk() で配列のリセットがデフォ ルトで行われないため、 reset() をコールする必要 があります。
The printout of the program above will be:
例 1 array_walk() の例
See also list(), foreach, each(), and call_user_func_array().
上記のプログラムの出力は次のようになります。
array_values
each() および list() も参照下さい。
(PHP 3, PHP 4)
(PHP 3, PHP 4)
This is used mainly when sorting associative arrays where the actual element order is significant.
この関数は、連想配列において各配列のキーと要素との関係を維持しつ つソートを行います。この関数は、主に実際の要素の並び方が重要であ る連想配列をソートするために使われます。
Example 1. arsort() example
例 1 arsort() の例
This example would display:
この例は、以下のように出力されます。
The fruits have been sorted in reverse alphabetical order, and the index associated with each element has been maintained.
fruitsはアルファベットの逆順にソートされ、各要素とキーとの関係は 維持されます。
See also asort(), rsort(), ksort(), and sort().
オプションのパラメータ sort_flags によりソー トの動作を修正可能です。詳細については、 sort() を参照下さい。
Home
asort(), rsort(), ksort(), sort() も参照下さい。
(PHP 3 = 3.0.17)
(PHP 3 = 3.0.17)
It translates the ASCII encoded string ascii_str to its equivalent EBCDIC representation (binary safe), and returns the result.
ascii2ebcdic() は、EBCDICに基づくオペレーティング システム (OS/390, BS2000)でのみ使用可能なApache専用の関数です。 この関数は、ASCIIエンコードされた文字列 ascii_str を等価なEBCDIC表現(バイナリ対応)に 変換し、結果を返します。
Prev
逆の動作をする関数 ebcdic2ascii() も参照下さい。
Prev
(PHP 4 = 4.1.0)
Returns the inverse hyperbolic sine of arg, i.e. the value whose hyperbolic sine is arg.
arg の逆双曲線正弦、すなわち、双曲線正弦が arg であるような値を返します。
This function is not implemented on Windows platforms.
注意 この関数はWindows環境にはまだ実装されていません。
Prev
asin(), acos(), atan() も参照下さい。
Prev
(PHP 3, PHP 4)
Returns the arc sine of arg in radians. asin() is the complementary function of sin(), which means that a==sin(asin(a)) for every value of a that is within asin() 's range.
引数argのアークサインをラジアンで返します。
Prev
asinh(), acos(), atan() も参照下さい。
(PHP 3, PHP 4)
(PHP 3, PHP 4)
This is used mainly when sorting associative arrays where the actual element order is significant.
この関数は、連想配列において各配列のキーと要素との関係を維持しつ つ配列をソートします。この関数は、主に実際の要素の並び方が重要で ある連想配列をソートするために使われます。
Example 1. asort() example
例 1 asort() の例
This example would display:
この例は、以下のように出力されます。
The fruits have been sorted in alphabetical order, and the index associated with each element has been maintained.
fruitsはアルファベットの昇順にソートされ、各要素とキーとの関係は 維持されます。
See also arsort(), rsort(), ksort(), and sort().
オプションのパラメータ sort_flags によりソー トの動作を修正可能です。詳細については、 sort() を参照下さい。
Home
arsort(), rsort(), ksort(), sort() も参照下さい。
aspell_check() checks the spelling of a word and returns TRUE if the spelling is correct, FALSE if not.
(PHP 3 = 3.0.7, PHP 4 = 4.2.3)
$aspell_link = aspell_new( "english"); if (aspell_check($aspell_link, "testt")) {echo "This is a valid spelling";} else {echo "Sorry, wrong spelling";}
aspell_check() は単語のスペルをチェックし、 スペルが正しい場合には TRUE 、そうでない場合は FALSE を返します。
aspell_check_raw
例 1 aspell_check()
aspell_check_raw() checks the spelling of a word, without changing its case or trying to trim it in any way and returns TRUE if the spelling is correct, FALSE if not.
(PHP 3 = 3.0.7, PHP 4 = 4.2.3)
$aspell_link = aspell_new( "english"); if (aspell_check_raw($aspell_link, "test")) {echo "This is a valid spelling";} else {echo "Sorry, wrong spelling";}
aspell_check_raw() は単語のスペルをチェックし、 大文字小文字変換や何らかの削除を行うことなく、スペルが正しい場合に TRUE 、そうでない場合に FALSE を返します。
Aspell functions [deprecated]
例 1 aspell_check_raw()
(PHP 3 = 3.0.7, PHP 4 = 4.2.3)
(PHP 3 = 3.0.7, PHP 4 = 4.2.3)
Returns FALSE on error.
aspell_new() は、新規辞書をオープンし、他の aspell関数で使用される辞書リンクIDを返します。エラー時に FALSE を返します。
$aspell_link = aspell_new( "english");
例 1 aspell_new()
aspell_suggest() returns an array of possible spellings for the given word.
(PHP 3 = 3.0.7, PHP 4 = 4.2.3)
$aspell_link = aspell_new( "english"); if (!aspell_check($aspell_link, "test")) {$suggestions = aspell_suggest($aspell_link, "test"); foreach ($suggestions as $suggestion) {echo "Possible spelling: $suggestion br \n";}}
aspell_suggest() は、指定した単語に関してあり そうなスペルの配列を返します。
BCMath Arbitrary Precision Mathematics Functions
例 1 aspell_suggest()
(PHP 4)
(PHP 4)
If the assertion is given as a string it will be evaluated as PHP code by assert().
assert() は、指定した assertion を調べて、結果が FALSE の場合に適当な動作をします。
Assertions should not be used for normal runtime operations like input parameter checks.
assertion は、デバッグ目的にのみ使用するべきです。 assertion を常に TRUE となる条件を調べる不具合診断に使用し、 TRUE でな い場合に何らかのプログラミングエラーを示したり、extension 関数ま たは特定のシステム制限や機能といった特定の機能の存在をチェックす るために使用することが可能です。
The behavior of assert() may be configured by assert_options() or by .ini-settings described in that functions manual page.
assersion は、入力パラメータのチェックのような通常の実行動作に使 用するべきではありません。一般的には、assertion のチェックが有効 でない場合に自分のコードを常に正常に動作することができる必要があり ます。
assert() callbacks are particularly useful for building automated test suites because they allow you to easily capture the code passed to the assertion, along with information on where the assertion was made.
assert() の動作は、 assert_options() またはマニュアルの関数の部分 に記述された .ini の設定により設定することが可能です。
The callback function should accept three arguments.
関数 assert_options() かつ/または ASSERT_CALLBACK 設定ディレクティブにより失敗したassertionを 処理するコールバック関数を設定することが可能です。
The second argument will contain the line the assertion failed on and the third argument will contain the expression that failed (if any - literal values such as 1 or "two "will not be passed via this argument)
assert() のコールバックは、assertionが発生 した場所に関する情報と共にassertionに渡されたコードを容易にキャ プチャーできるため、特に自動テストセットを構築する際に便利です。 この情報は他の手法でもキャプチャー可能ですが、assertionを使用 することにより、より簡単かつ容易に行なうことが可能です!
File '$file' br Line '$line 'br Code '$code' br hr ";} / / Set up the callback assert_options (ASSERT_CALLBACK, 'my_assert_handler'); / / Make an assertion that should fail assert ('mysql_query ("")');?
コールバック関数は、3つの引数を受ける必要があります。最初の引数 は、assertionが失敗したファイルが含まれます。2番目の引数には、 assertionが失敗した行が含まれ、3番目の引数には失敗した式が含ま れます。(もしある場合のみ。1または"two"のようなリテラルの値はこ の引数に渡されません)
assert_options
例 1カスタムハンドラで失敗したassertionを処理する
Prev
(PHP 4)
Using assert_options() you may set the various assert() control options or just query their current settings.
assert_options() を使用して、種々の assert() 制御オプションを設定したり、 単にカレントの設定を調べたりすることが可能です。
ASSERT_CALLBACK
表 1assert オプション
assert_options() will return the original setting of any option or FALSE on errors.
assert_options() は、指定したオプションの元の 設定値またはエラーの場合に FALSE を返します。
(PHP 3 = 3.0.5, PHP 4)
(PHP 3 = 3.0.5, PHP 4)
It is similar to calculating the arc tangent of y / x, except that the signs of both arguments are used to determine the quadrant of the result.
この関数は、変数 x,y のアークタンジェントを計算します。 y / x のアークタンジェントを計算するのに似ていますが、 2つの引数の符号を用いて結果の4象元位置を定義する ことが異なっています。
See also acos() and atan().
この関数は、結果を -PI から PI の間(両端を含む)のラジアンで返しま す。
Home
acos() および atan() も参照下さい。
Prev
(PHP 4 = 4.1.0)
Returns the inverse hyperbolic tangent of arg, i.e. the value whose hyperbolic tangent is arg.
arg の逆双曲線正接、すなわち、 双曲線正接が arg となる値を返します。
This function is not implemented on Windows platforms.
注意 この関数はWindows環境にはまだ実装されていません。
Prev
atan(), asin(), acos() も参照下さい。
Prev
(PHP 3, PHP 4)
Returns the arc tangent of arg in radians. atan() is the complementary function of tan(), which means that a==tan(atan(a)) for every value of a that is within atan() 's range.
引数argのアークタンジェントをラジアンで返します。
Prev
atanh(), acos(), atan() も見てください。
Prev
(PHP 3, PHP 4)
base64_decode() decodes encoded_data and returns the original data.
base64_decode() は encoded_data をデコードし、 もとのデータを返します。バイナリになることもあります。
See also: base64_encode(), RFC 2045 section 6.8.
base64_encode() およびRFC-2045 6.8節も 参考にしてください。
(PHP 3, PHP 4)
(PHP 3, PHP 4)
This encoding is designed to make binary data survive transport through transport layers that are not 8-bit clean, such as mail bodies.
base64_encode() は、 data をbase64方式でエンコードします。 このエンコードは、メールの本体の様に、8ビットクリーンでは ないトランスポート層を通じて、バイナリーデータが生き残れる 様に設計されています。
See also: base64_decode(), chunk_split(), RFC 2045 section 6.8.
Base64でエンコードされたデータは、エンコード前のデータにくらべて 33%余計に容量が必要です。
base64_decode
base64_decode(), chunk_split(), RFC-2045 6.8節も参照下さい。
The base in which number is given is specified in frombase.
(PHP 3 = 3.0.6, PHP 4)
Digits in numbers with a base higher than 10 will be represented with the letters a-z, with a meaning 10, b meaning 11 and z meaning 35.
number を基底 tobase で表した文字列を返します。 number の基底は、 frombase で指定します。 frombase および tobase は共に2から36までである必要があります。 10 より大きな基底を有する数の各桁は、文字 a-z で表されます。 この場合、a は 10、b は 11、z は 36 を意味します。
$binary = base_convert ($hexadecimal, 16, 2);
例 1 base_convert()
If the filename ends in suffix this will also be cut off.
(PHP 3, PHP 4)
In other environments, it is the forward slash (/).
この関数は、ファイルへのパスを有する文字列を引数とし、 ファイルのベース名を返します。ファイル名が、 suffix で終了する場合、この部分もカットされ ます。
$path = "/ home / httpd / html / index.php"; $file = basename ($path); / / $file is set to "index.php" $file = basename ($path ,".php"); / / $file is set to "index "
Windows では、スラッシュ( / )とバックスラッシュ (\ )の両方がパス区切り文字として使われます。 その他の環境ではスラッシュ( / )になります。
The suffix parameter was added in PHP 4.1.0.
例 1 basename() の例
Prev
注意 パラメータ suffix は、PHP 4.1.0で追加されま した。
Filesystem functions
dirname() も参照下さい。
(PHP 3, PHP 4)
(PHP 3, PHP 4)
The optional scale parameter is used to set the number of digits after the decimal place in the result.
left operand を right operand に加算して、その合計を文字列で返します。 オプションの scale パラメータは、結果における 小数点以下の桁数を指定するために使用します。
BCMath Arbitrary Precision Mathematics Functions
bcsub() も参照下さい。
The optional scale The optional scale parameter is used to set the number of digits after the decimal place which will be used in the comparison.
(PHP 3, PHP 4)
If the left_operand is larger than the right_operand the return value is +1 and if the left_operand is less than the right_operand the return value is -1.
left operand を right operand と比較して、その結果を整数で返します。 オプションの scale パラメータは、結果における 小数点以下の桁数を指定するために使用します。 オプションの2つのオペランドが等しければ返り値は0となります。 left operand が right operand より大きければ返り値は +1になり、小さければ -1 になります。
(PHP 3, PHP 4)
(PHP 3, PHP 4)
The optional scale sets the number of digits after the decimal place in the result.
left operand を right operand で除算して、その結果を返します。 オプションの scale パラメータは、結果における 小数点以下の桁数を指定するために使用します。
Prev
bcmul() も参照下さい。
Prev
(PHP 3, PHP 4)
Get the modulus of the left_operand using modulus.
modulus で left operand を割った余りを求めます。