What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » General » General Chit Chat » Random Word [site]

Random Word [site]
Author: Message:
the DtTvB
Junior Member
**


Posts: 47
Reputation: 10
– / Male / –
Joined: Mar 2007
Status: Away
RE: Random Word [site]
You just have to create a list of characters [1] [2] and select it randomly.

code:
<?php

$charlist = (array_merge(
    range('0', '9'),
    range('a', 'z'),
    range('A', 'Z')
));

function pick_a_character() {
    global $charlist;
    return $charlist[rand(0, count($charlist) - 1)];
}

function create_code($length) {
    $o = '';
    for ($i = 0; $i < $length; $i ++)
        $o .= pick_a_character();
    return $o;
}

$code = create_code(12);
echo "The code is $code";

?>

This post was edited on 03-26-2007 at 09:24 AM by the DtTvB.
the DtTvB - My name has no meaning, but it's unique at least!
[Image: asj.gif]
03-26-2007 09:17 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Random Word [site] - by Eddie on 03-26-2007 at 08:22 AM
RE: Random Word [site] - by the DtTvB on 03-26-2007 at 09:09 AM
RE: Random Word [site] - by Eddie on 03-26-2007 at 09:11 AM
RE: Random Word [site] - by the DtTvB on 03-26-2007 at 09:17 AM
RE: Random Word [site] - by Felu on 03-26-2007 at 09:18 AM
RE: Random Word [site] - by Eddie on 03-26-2007 at 10:00 AM
RE: Random Word [site] - by Volv on 03-26-2007 at 12:13 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On