【发布时间】:2018-03-11 20:15:21
【问题描述】:
在我的网站上加载页面时,我需要显示自动字词。我设法显示了一个词,但我看不到一个。重要的是这些词不要重复。
我有这个代码,我在其中指定每个单词。
<?php
$randomThings = array(
'random thing 1',
'random thing 2',
'random thing 3',
'random thing 4',
'random thing 5',
'random thing 6',
'random thing 7 ',
);
?>
最后,我将这段代码粘贴到我想要显示的位置。
<?php echo $randomThings[mt_rand(0,count($randomThings)-1)]; ?>
正如我所说,一个词正确地显示给我,但我想显示多个。
非常感谢,对不起我的英语
【问题讨论】: