Re: Random Number generating and adding it to he database..
| From: | Samar | Date: | Sun, 23 Jan 2005 12:03:23 +0000 |
| Subject: | Re: Random Number generating and adding it to he database.. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-38275@lists.php.net to get a copy of this message | ||
On Sun, 23 Jan 2005 10:43:03 +0400, Radwan Aladdin
<raladin@emirates.net.ae> wrote:
> I wanted to know the best Random Function for PHP.. But please I don't want
> >duplications to happen at the same second.. because I receive many customers..
For that purpose, mt_rand ( [int min, int max]) function is your best
friend, I guess.
See http://in2.php.net/manual/en/function.mt-rand.php
for more details.
> And also how can I add abc@localhost.com, whic "abc" is a variable... and
> >"localhost.com" is a static text??
> So I only request from the user to enter the "abc" only and it will automatically
> >be : usertexthere@localhost.com
//Do you mean --
$user = "someuser";
echo $user;
//And you wish to make someuser@localhost.com ?
//Then,
$email_address = $user . "@localhost.com";
echo $email_address;
//Will output someuser@localhost.com
The dot (.) is the cocatenation (string-joining) operator.
Regards,
Samar M.
= Warning: Dates in Calendar are closer than they appear.