1 Star 0 Fork 160

limnazhen/dgpt4711-lab4

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.php 996 Bytes
一键复制 编辑 原始数据 按行查看 历史
Xavier 提交于 2021-09-25 08:39 . Initial commit of all project files
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<p>You should consider getting a
<?php
// Load files
$f_adjectives = fopen("adjectives", "r");
$f_colours = fopen("colours", "r");
$f_nouns = fopen("nouns", "r");
// Create Arrays
$adjectives = array();
$colours = array();
$nouns = array();
// Load Strings into Arrays
while ( ! feof($f_adjectives))
{
array_push($adjectives, fgets($f_adjectives));
}
while ( ! feof($f_colours))
{
array_push($colours, fgets($f_colours));
}
while ( ! feof($f_nouns))
{
array_push($nouns, fgets($f_nouns));
}
// Pick random word and print
$index = rand(0, sizeof($adjectives) - 1);
echo $adjectives[$index];
echo " ";
$index = rand(0, sizeof($colours) - 1);
echo $colours[$index];
echo " ";
$index = rand(0, sizeof($nouns) - 1);
echo $nouns[$index];
echo " ";
?>
for a pet.</p>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/limnazhen/dgpt4711-lab4.git
git@gitee.com:limnazhen/dgpt4711-lab4.git
limnazhen
dgpt4711-lab4
dgpt4711-lab4
develop

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385