File_Fortune::getAll

File_Fortune::getAll() – 現在のファイルからすべての fortune を取得する

Synopsis

require_once 'File/Fortune.php';

array File_Fortune::getAll ( )

Description

getAll() を使用すると、 fortune データベースの内容全体を配列に取り込むことができます。 これはあまりよい考えではありません。というのも、 fortune ファイルはかなり大きなサイズとなることがあるからです。 個々の fortune に対して何らかの処理を行いたい場合は、 File_Fortune オブジェクトを次のように使用すればいいでしょう。

<?php
foreach ($fortunes as $fortune) {
    
// 各 fortune に対する何らかの処理
}
?>

注意: getAll() は、 複数のファイルやディレクトリが設定されている場合にも使用可能です。 この場合は、すべてのファイルにあるすべての fortune を返します。

Throws

例外はスローされません。

Note

This function can not be called statically.