PHP半随机字生成器[关闭]

The following code is working. But I'd like to improve it. Basically, this page displays a random str per each categories and reloads a page when a user pushes a button. Can it be different so I could manage the data easier(I want to update the words library frequently). I also wonder if this is short enough for quick loading. Thank you so much for your help in advance.

<!-- begin -->
<html>
<head>
</head>

<body>


<?php 
#hash = random url generated from 128 chars


$words = array('apple', 'orange', 'banana'); 
$rword = rand(0,2);

$syms = array('chair', 'sofa', 'table', 'coffee table');
$rsym = rand(0,3); 

$value1 = $words[$rword];
$final1 = strtoupper($value1);

$value2 = $syms[$rsym];
$final2 = strtoupper($value2);

?>


<h2>Fruit</h2><p><?php echo $final1 = strtolower($value1); ?></p>
<h2>Furniture</h2><p><?php echo $final2 = strtolower($value2); ?></p>


<FORM METHOD="LINK" ACTION="random.php">
<INPUT TYPE="submit" VALUE="generate again">
</FORM>



</body>
</html>

<!-- end -->

I would create a Database with 2 tables.

Table 1 would be Categories: This would contain Fruit,Furniture,Rivers,etc.

Table 2 would be Items: This would contain chair,apple,sofa,orange,etc. all associated to the correct Categories id.

You could then query for ALL categories and return that into a full array. You could then foreach your way through the array of categories and do another query set to an array of items. Once you do that you can get the length of items and do much the same as you are doing.

This is a descriptive answer to give you an idea that you should move to. Without knowledge of your exact idea and structure set I do not want to risk writing faulty code.