示例#1
0
<?php

include "analyticstracking.php";
function printRandomItem($array)
{
    echo $array[array_rand($array)];
}
$firstname1 = array("Twinkle", "Sparkle", "Glitter", "Little", "Ginger", "Bartle", "Bob", "Tiny", "Green", "Blue", "Orange", "Purple", "Rainbow", "Peach", "Elbow", "Tingle", "Polar", "Doodle", "Brownie", "Thimble", "Funky", "Fun", "Rumple");
$firstname2 = array("face", "foot", "toot", "root", "bell", "dog", "cat", "small", "peach", "bee", "bear", "butt", "feather", "muffin", "ish");
$lastname1 = array("Cod", "Tree", "Sting", "Soy", "Window", "Winter", "Green", "Blue", "Orange", "Purple", "Rainbow", "Gold", "Ten", "Eleven", "Tickle", "Curry", "Pan", "Oven", "Stinker", "Snicker", "Salty", "Turtle", "Un", "Fun", "Leg", "Rumple", "Rude", "Hairy", "Cookie", "Twitter", "Apple");
$lastname2 = array("melon", "fence", "fart", "by", "metal", "paste", "thwait", "tree", "doodle", "salmon", "fish", "bottom", "poodle", "caper", "muscle", "asaurus", "skeleton", "draxx", "sklounst", "chunk", "armpit", "piece", "fight", "wing", "muffin", "monster", "blaster", "monger", "bot");
printRandomItem($firstname1);
printRandomItem($firstname2);
echo ' ';
printRandomItem($lastname1);
printRandomItem($lastname2);
echo PHP_EOL;
示例#2
0
$enemyWords = array("FOE", "SCOURGE", "TERROR", "HORROR", "DEMON");
$places = array("SPAIN", "THE VILLAGE", "THE KINGDOM", "MY BUTT", "TRANSYLVANIA");
$descriptiveAdjective = array("THE RED", "THE ORANGE", "CREEPING", "THE BLUE");
$badNoun = array("MENACE", "DEATH", "TERROR", "DEMON", "DOOM", "DARKNESS");
printRandomItem($firstname1);
printRandomItem($firstname2);
echo ' ';
printRandomItem($lastname1);
printRandomItem($lastname2);
echo ',';
echo PHP_EOL;
$whuh = rand(0, 2);
if ($whuh == 0) {
    // <Ally> of <Bad thing>
    printRandomItem($friendWords);
    echo ' OF ';
    printRandomItem($badThings);
} else {
    if ($whuh == 1) {
        // <Noun> of <Place>
        printRandomItem($enemyWords);
        echo ' OF ';
        printRandomItem($places);
    } else {
        // The <Adjective> <Noun>
        printRandomItem($descriptiveAdjective);
        echo ' ';
        printRandomItem($badNoun);
    }
}
echo PHP_EOL;