class word {
public $hinshi;
public $ja;
public $jaYomi;
public $jaCount;
public $en;
public $enYomi;
function __construct( $h, $z, $j, $jy, $jc, $e, $eY ) {
$this->hinshi = $h;
$this->zokusei = $z;
$this->ja = $j;
$this->jaYomi = $jy;
$this->jaCount = $jc;
$this->en = $e;
$this->enYomi = $eY;
}
}
$words[1] = new word( "名詞", "", "愛", "あい", 2, "love", "ラブ" );
$words[] = new word( "名詞", "", "惡", "あく", 2, "evil", "イービル" );
$words[] = new word( "名詞", "", "脚", "あし", 2, "foot", "フット" );
mt_srand();
echo $words[ mt_rand(1, count($words) ) ]->ja;