Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
index.php 996 Bytes
Copy Edit Raw Blame History
Xavier authored 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>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化