ランダムな fortune の取得
<?php
require_once 'File/Fortune.php';
// 単一の fortune ファイルから取得します
$fortunes = new File_Fortune('/path/to/fortune/file');
echo $fortunes->getRandom();
// 複数の fortune ファイルを含むディレクトリから取得します
$fortunes = new File_Fortune('/path/to/fortune/files/');
echo $fortunes->getRandom();
?> |
すべての fortunes の取得
<?php
require_once 'File/Fortune.php';
$fortunes = new File_Fortune('/path/to/fortune/file');
$cached = $fortunes->getAll();
// あるいは、すべてのファイルからすべての fortune を取得します
$fortunes->setDirectory('/path/to/fortunes/');
$cached = $fortunes->getAll();
?> |
fortune の数の取得
<?php
require_once 'File/Fortune.php';
$fortunes = new File_Fortune('/path/to/fortune/file');
$count = count($fortunes);
// あるいは、すべてのファイルに含まれる fortune の数を調べます
$fortunes->setDirectory('/path/to/fortunes/');
$count = count($fortunes);
?> |
fortune のループ処理
<?php
require_once 'File/Fortune.php';
$fortunes = new File_Fortune('/path/to/fortune/file');
foreach ($fortunes as $fortune) {
echo $fortune;
}
?> |
注意: これは、複数のファイルやディレクトリを指定した場合には例外を発生します。
fortune の操作
<?php
require_once 'File/Fortune.php';
$fortunes = new File_Fortune('/path/to/fortune/file');
// fortune の削除
unset($fortunes[2]); // 2 番目の位置にある fortune を削除します
// fortune の更新
$fortune[2] = "こんな占いなんて大っ嫌い"; // 2 番目の位置にある fortune を更新します
?> |
注意: これは、複数のファイルやディレクトリを指定した場合には例外を発生します。
fortune の追加
<?php
require_once 'File/Fortune.php';
$fortunes = new File_Fortune('/path/to/fortune/file');
$fortunes->add('光り輝く新規メッセージ!');
?> |
注意: これは、複数のファイルやディレクトリを指定した場合には例外を発生します。
新しい fortune ファイルの作成
<?php
require_once 'File/Fortune.php';
$newFortunes = array(
'メッセージ 1',
'メッセージ 2',
'メッセージ 3'
);
$fortunes = new File_Fortune('/path/to/fortune/file');
$fortunes->create($newFortunes);
?> |
注意: これは、複数のファイルやディレクトリを指定した場合には例外を発生します。
大阪 老人ホーム 京都 老人ホーム 兵庫 老人ホーム 和歌山 老人ホーム 滋賀 老人ホーム
奈良 老人ホーム 東京 老人ホーム 神奈川 老人ホーム 千葉 老人ホーム 埼玉 老人ホーム
老人ホーム 断熱塗料 表札
- 大阪 人妻

大阪の人妻デリヘル、ヘルス、ホテヘルの紹介サイト
- デリヘル

全国の地域別のデリヘル紹介サイト
- パソコン

パソコン日記ホームページの紹介