I needed something like this echo(rand(1,30))
On 5/24/13, Last Hacker Always onpoint lasthack...@gmail.com wrote:
okay thanks tamouse and others you think am not on point hmmm? I'll
show you i am.
On 5/24/13, tamouse mailing lists tamouse.li...@gmail.com wrote:
On Thu, May 23, 2013 at 3:51
Last Hacker Always onpoint lasthack...@gmail.com wrote:
I needed something like this echo(rand(1,30))
On 5/24/13, Last Hacker Always onpoint lasthack...@gmail.com wrote:
okay thanks tamouse and others you think am not on point hmmm? I'll
show you i am.
On 5/24/13, tamouse mailing lists
Lola
On Friday, May 24, 2013, Ashley Sheridan wrote:
Last Hacker Always onpoint lasthack...@gmail.com javascript:; wrote:
I needed something like this echo(rand(1,30))
On 5/24/13, Last Hacker Always onpoint lasthack...@gmail.comjavascript:;
wrote:
okay thanks tamouse and others you
On 5/24/2013 3:04 AM, Last Hacker Always onpoint wrote:
I needed something like this echo(rand(1,30))
On 5/24/13, Last Hacker Always onpoint lasthack...@gmail.com wrote:
okay thanks tamouse and others you think am not on point hmmm? I'll
show you i am.
On 5/24/13, tamouse mailing lists
On 23 May 2013, at 21:51, Last Hacker Always onpoint lasthack...@gmail.com
wrote:
Hey I need code for random number 1-30 for my site.
Seriously? Did you try to find out how to do this yourself before asking here?
http://php.net/rand
And, more generally:
http://php.net/docs
-Stuart
--
On Thu, May 23, 2013 at 4:51 PM, Last Hacker Always onpoint
lasthack...@gmail.com wrote:
Hey I need code for random number 1-30 for my site.
You need to know that you've been removed from the list (but you'd
still have to be subscribed to be able to read this).
--
/Daniel P. Brown
Network
On May 23, 2013, at 4:54 PM, Daniel Brown danbr...@php.net wrote:
On Thu, May 23, 2013 at 4:51 PM, Last Hacker Always onpoint
lasthack...@gmail.com wrote:
Hey I need code for random number 1-30 for my site.
You need to know that you've been removed from the list (but you'd
still have to
On 13-05-23 04:51 PM, Last Hacker Always onpoint wrote:
Hey I need code for random number 1-30 for my site.
http://php.net/manual/en/function.rand.php
--
Stephen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
His gmail name should be Last last last last Hacker hacker acker
not-cker Never On-point :)
On Thu, May 23, 2013 at 4:51 PM, Last Hacker Always onpoint
lasthack...@gmail.com wrote:
Hey I need code for random number 1-30 for my site.
--
PHP General Mailing List (http://www.php.net/)
To
On Thu, May 23, 2013 at 3:51 PM, Last Hacker Always onpoint
lasthack...@gmail.com wrote:
Hey I need code for random number 1-30 for my site.
function rand_from_1_to_30() {
return 4;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
okay thanks tamouse and others you think am not on point hmmm? I'll
show you i am.
On 5/24/13, tamouse mailing lists tamouse.li...@gmail.com wrote:
On Thu, May 23, 2013 at 3:51 PM, Last Hacker Always onpoint
lasthack...@gmail.com wrote:
Hey I need code for random number 1-30 for my site.
On 2/9/2013 11:58 AM, Mike Mackintosh wrote:
On Saturday, February 9, 2013 at 11:51 AM, Geoff Shang wrote:
On Sat, 9 Feb 2013, Jim Giner wrote:
Lately, my web pages are giving me some problems. Once a day or so one or
more of my pages/scripts will give me a 404 error page saying my web
On Sat, Feb 9, 2013 at 11:51 AM, Geoff Shang ge...@quitelikely.com wrote:
On Sat, 9 Feb 2013, Jim Giner wrote:
Lately, my web pages are giving me some problems. Once a day or so one or
more of my pages/scripts will give me a 404 error page saying my web page
has timed out. Problem is that
On 2/10/2013 12:45 PM, Andy McKenzie wrote:
On Sat, Feb 9, 2013 at 11:51 AM, Geoff Shang ge...@quitelikely.com wrote:
On Sat, 9 Feb 2013, Jim Giner wrote:
Lately, my web pages are giving me some problems. Once a day or so one or
more of my pages/scripts will give me a 404 error page saying
On Sun, Feb 10, 2013 at 6:53 PM, Jim Giner jim.gi...@albanyhandball.comwrote:
On 2/10/2013 12:45 PM, Andy McKenzie wrote:
On Sat, Feb 9, 2013 at 11:51 AM, Geoff Shang ge...@quitelikely.com
wrote:
On Sat, 9 Feb 2013, Jim Giner wrote:
Lately, my web pages are giving me some problems. Once
Im pretty sure its not a script error cause it always works a second later
jg
On Feb 10, 2013, at 2:48 PM, Matijn Woudt tijn...@gmail.com wrote:
On Sun, Feb 10, 2013 at 6:53 PM, Jim Giner jim.gi...@albanyhandball.com
wrote:
On 2/10/2013 12:45 PM, Andy McKenzie wrote:
On Sat, Feb 9,
This is a tough one.
Lately, my web pages are giving me some problems. Once a day or so one
or more of my pages/scripts will give me a 404 error page saying my web
page has timed out. Problem is that the page was just displayed. I
click on a link, the page shows up, I click on a button on
On Sat, Feb 9, 2013 at 10:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:
This is a tough one.
Lately, my web pages are giving me some problems. Once a day or so one or
more of my pages/scripts will give me a 404 error page saying my web page
has timed out. Problem is that the page was
On 2/9/2013 11:21 AM, Andy McKenzie wrote:
Smart money is that it's nothing to do with you; in my experience,
that's usually a network problem. It could be on your end (I'm seeing
that a lot more often now that I've moved to a new house, or it could
be a problem with the server's connection.
On Sat, 9 Feb 2013, Jim Giner wrote:
Lately, my web pages are giving me some problems. Once a day or so one or
more of my pages/scripts will give me a 404 error page saying my web page has
timed out. Problem is that the page was just displayed. I click on a link,
the page shows up, I click
On Saturday, February 9, 2013 at 11:51 AM, Geoff Shang wrote:
On Sat, 9 Feb 2013, Jim Giner wrote:
Lately, my web pages are giving me some problems. Once a day or so one or
more of my pages/scripts will give me a 404 error page saying my web page
has
timed out. Problem is that the
Hi,
my website have french and english users (most are french)
I use gettext for the translation.
But sometimes (it's random), french users have english word and english
users have french word.
Why ? My Apache is compiled with prefork, so i don't understand ...
My config :
PHP 5.3.9
A question was posted on another board that the poster wanted random flash
movies to display as the page is reloaded. I posted the script below and
said I thought it could be adapted but that the echo would probably need to
change. Can someone offer some guidance on this? Thanks
Gary
?
On Sun, 2009-09-20 at 11:30 -0400, Gary wrote:
A question was posted on another board that the poster wanted random flash
movies to display as the page is reloaded. I posted the script below and
said I thought it could be adapted but that the echo would probably need to
change. Can
On Sun, Sep 20, 2009 at 11:33 AM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
On Sun, 2009-09-20 at 11:30 -0400, Gary wrote:
A question was posted on another board that the poster wanted random flash
movies to display as the page is reloaded. I posted the script below and
said I thought
Is there a way to have a php include called ramdomly? For example, I have
an area that I am using to show various quotes and I would like the quotes
to be ramdom.
Thanks for your help
Gary
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
'php random quote' you'll see lots of samples or
complete code.
Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
is to use a storage system ( either file with a quote in each line
or a database ) and then randomly select a record from the database or
an item from the file. If you do a quick search on www.hotscripts.com or
just goodle 'php random quote' you'll see lots of samples or complete
code
( either file with a quote in each line
or a database ) and then randomly select a record from the database or
an item from the file. If you do a quick search on www.hotscripts.com or
just goodle 'php random quote' you'll see lots of samples or complete
code.
Bastien
--
PHP General
On Sun, Apr 12, 2009 at 1:32 AM, Gary gwp...@ptd.net wrote:
I had been on that site before, but seems like it is a breeding ground for
spam and links to free commercial sites. Ran into a few bad or broken
links, several listings as different scripts only to take you to the same
best price
Hi
you can use PHP rand() function for selecting a random number between 1 to
100.
http://www.senpai-it.com/dedicated_servers.php Senpai IT Solutions
Dedicated Server at low cost
WEISD wrote:
On a php web page I want to generate a random number between say 1 and 10
and then use that
On Thu, Nov 6, 2008 at 3:52 AM, Amisha_Sharma [EMAIL PROTECTED] wrote:
Hi
you can use PHP rand() function for selecting a random number between 1 to
100.
Amisha,
Welcome to the list, but please don't top post. For a list of all
the guidelines for the official PHP lists, including
On Thu, Nov 6, 2008 at 10:53 AM, WEISD [EMAIL PROTECTED] wrote:
Gary M. Josack [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Stephen wrote:
On a php web page I want to generate a random number between say 1 and
10 and then use that number to reference a particular file in
an
Gary M. Josack [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Stephen wrote:
On a php web page I want to generate a random number between say 1 and
10 and then use that number to reference a particular file in
an include tag.
?php include('GeneratedNumber.html'); ?
Is there an
[snip]
?php
$number = rand(1, 10);
include(footer$number.html); ?
You can see it in action here at the bottom of the page there is a
footer.
Each footer is the same right now except I have numbered them for
testing.
As I refresh the page, I get footer10 almost always with an occasional
2 or
On Thu, 11/6/08, WEISD [EMAIL PROTECTED] wrote:
That is strange. I get pretty balanced results on this
computer.
?php
$histogram = array_fill(1, 10, 0);
$iterations = 20;
for ($i = 0; $i $iterations; ++$i) {
++$histogram[round(rand(1, 10))];
}
WEISD wrote:
That is strange. I get pretty balanced results on this computer.
?php
$histogram = array_fill(1, 10, 0);
$iterations = 20;
for ($i = 0; $i $iterations; ++$i) {
++$histogram[round(rand(1, 10))];
}
print_r($histogram);
?
Andrew
Simple code,
?php
$number =
Computer functions to generate random numbers are not designed to do what
their name suggests.
Software testing requires repeatability, and this includes random number
generation.
Without knowing how PHP seeds the generator it is difficult to predict
what it will do.
I still think
That is strange. I get pretty balanced results on this computer.
?php
$histogram = array_fill(1, 10, 0);
$iterations = 20;
for ($i = 0; $i $iterations; ++$i) {
++$histogram[round(rand(1, 10))];
}
print_r($histogram);
?
Andrew
Simple code,
?php
$number = rand(1, 10);
WEISD wrote:
Computer functions to generate random numbers are not designed to do
what their name suggests.
Software testing requires repeatability, and this includes random
number generation.
Without knowing how PHP seeds the generator it is difficult to predict
what it will do.
I
WEISD wrote:
Computer functions to generate random numbers are not designed to do
what their name suggests.
Software testing requires repeatability, and this includes random
number generation.
Without knowing how PHP seeds the generator it is difficult to predict
what it will do.
I
At 10:30 AM -0600 11/6/08, WEISD wrote:
You can see it in action here at the bottom of the page there is a
footer. Each footer is the same right now except I have numbered
them for testing.
As I refresh the page, I get footer10 almost always with an
occasional 2 or 4 here and there...
http://www.weisd.com/store2/WINHD-9022.php
Not me -- I get a normal distribution.
Cheers,
tedd
Thanks Tedd, That is because it is using time now and not rand...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Stephen wrote:
On Thu, 11/6/08, WEISD [EMAIL PROTECTED] wrote:
That is strange. I get pretty balanced results on this
computer.
?php
$histogram = array_fill(1, 10, 0);
$iterations = 20;
for ($i = 0; $i $iterations; ++$i) {
++$histogram[round(rand(1, 10))];
}
1. change the number to a string: $t = (string) time();
2. chop off the last char of the string: $char = substr($t, -1);
3. you're done...: include footer$char.html;
Time wins certainly produces better results, at least for what I am
doing, than rand...
Thanks all for your input...
At 11:35 AM -0600 11/6/08, WEISD wrote:
http://www.weisd.com/store2/WINHD-9022.php
Not me -- I get a normal distribution.
Cheers,
tedd
Thanks Tedd, That is because it is using time now and not rand...
Just as point of notice.
When I ask a question and provide a url, I keep the url
On a php web page I want to generate a random number between say 1 and 10
and then use that number to reference a particular file in an include tag.
?php include('GeneratedNumber.html'); ?
Is there an easy way to do this?
Thanks
--
PHP General Mailing List (http://www.php.net/)
To
On a php web page I want to generate a random number
between say 1 and 10
and then use that number to reference a particular file in
an include tag.
?php include('GeneratedNumber.html'); ?
Is there an easy way to do this?
Get the time and use the last digit converting 0 to 10.
method.
Just starting out with PHP or is this a homework assignment? :)
-TG
- Original Message -
From: WEISD [EMAIL PROTECTED]
To: php-general@lists.php.net
Date: Wed, 5 Nov 2008 12:41:21 -0600
Subject: [PHP] Random number generator
On a php web page I want to generate a random
- Original Message -
From: WEISD [EMAIL PROTECTED]
To: php-general@lists.php.net
Date: Wed, 5 Nov 2008 12:41:21 -0600
Subject: [PHP] Random number generator
On a php web page I want to generate a random number between say 1 and
10
and then use that number to reference a particular file
Stephen wrote:
On a php web page I want to generate a random number
between say 1 and 10
and then use that number to reference a particular file in
an include tag.
?php include('GeneratedNumber.html'); ?
Is there an easy way to do this?
Get the time and use the last digit converting 0
assignment? :)
-TG
- Original Message -
From: WEISD [EMAIL PROTECTED]
To: php-general@lists.php.net
Date: Wed, 5 Nov 2008 12:41:21 -0600
Subject: [PHP] Random number generator
On a php web page I want to generate a random number between say 1
and 10
and then use that number to reference
assignment? :)
-TG
- Original Message -
From: WEISD [EMAIL PROTECTED]
To: php-general@lists.php.net
Date: Wed, 5 Nov 2008 12:41:21 -0600
Subject: [PHP] Random number generator
On a php web page I want to generate a random number between say 1 and
10
and then use that number
On Wed, 2008-11-05 at 12:41 -0600, WEISD wrote:
On a php web page I want to generate a random number between say 1 and 10
and then use that number to reference a particular file in an include tag.
?php include('GeneratedNumber.html'); ?
Is there an easy way to do this?
Thanks
Hi Larry,Paul,Zoltán
Thanks for your messages, adding ORDER BY RAND () worked just fine
:)
Eduardo
Larry Garfield [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
On Wednesday 16 May 2007, Eduardo Vizcarra wrote:
Hi
I would like to know if a SELECT SQL query list of records
2007. 05. 17, csütörtök keltezéssel 00.45-kor Larry Garfield ezt írta:
On Wednesday 16 May 2007, Eduardo Vizcarra wrote:
Hi
I would like to know if a SELECT SQL query list of records can be unsorted.
SELECT statement retrieves a list of records from a certain table starting
from
Hi
I would like to know if a SELECT SQL query list of records can be unsorted.
SELECT statement retrieves a list of records from a certain table starting
from record # 1 till record #N and when publishing the records, this is how
it is presented, in a sequential way, is there any way to not
At 5/16/2007 09:40 PM, Eduardo Vizcarra wrote:
I would like to know if a SELECT SQL query list of records can be unsorted.
SELECT statement retrieves a list of records from a certain table starting
from record # 1 till record #N and when publishing the records, this is how
it is presented, in a
On Wednesday 16 May 2007, Eduardo Vizcarra wrote:
Hi
I would like to know if a SELECT SQL query list of records can be unsorted.
SELECT statement retrieves a list of records from a certain table starting
from record # 1 till record #N and when publishing the records, this is how
it is
IIRC, the OP wanted to generate a unique key precisely to keep from
revealing the record ID to the end user... what about taking the
auto_increment value (easy to generate, assured to be unique) adding its
MD5 hash to another column in the table, then using that as the
published ID?
The only
On Sat, 2007-03-24 at 08:24 -0400, Jim McIntyre wrote:
IIRC, the OP wanted to generate a unique key precisely to keep from
revealing the record ID to the end user... what about taking the
auto_increment value (easy to generate, assured to be unique) adding its
MD5 hash to another column in the
2007. 03. 22, csütörtök keltezéssel 12.58-kor tedd ezt írta:
At 4:53 PM +0100 3/22/07, Németh Zoltán wrote:
2007. 03. 22, csütörtök keltezéssel 11.42-kor tedd ezt írta:
As for efficiency, that's probably not even worth mentioning in this
case.
why not? you would use 2 sql queries
On Fri, 2007-03-23 at 09:15 +0100, Németh Zoltán wrote:
// method 2
$time = microtime(TRUE);
for ($i = 1; $i = 5000; $i++) {
$done = FALSE;
while (!$done) {
$id = md5((microtime(TRUE) * (rand(1,1000) / 100)));
$sql = INSERT INTO idtest (id,cnt)
2007. 03. 23, péntek keltezéssel 08.13-kor Robert Cummings ezt írta:
On Fri, 2007-03-23 at 09:15 +0100, Németh Zoltán wrote:
// method 2
$time = microtime(TRUE);
for ($i = 1; $i = 5000; $i++) {
$done = FALSE;
while (!$done) {
$id = md5((microtime(TRUE) *
At 9:15 AM +0100 3/23/07, Németh Zoltán wrote:
2007. 03. 22, csütörtök keltezéssel 12.58-kor tedd ezt írta:
At 4:53 PM +0100 3/22/07, Németh Zoltán wrote:
2007. 03. 22, csütörtök keltezéssel 11.42-kor tedd ezt írta:
As for efficiency, that's probably not
even worth mentioning in this
2007. 03. 23, péntek keltezéssel 15.13-kor tedd ezt írta:
At 9:15 AM +0100 3/23/07, Németh Zoltán wrote:
2007. 03. 22, csütörtök keltezéssel 12.58-kor tedd ezt írta:
At 4:53 PM +0100 3/22/07, Németh Zoltán wrote:
2007. 03. 22, csütörtök keltezéssel 11.42-kor tedd ezt írta:
As for
Use auto_increment.
It's not random, but you should never show it to the end user anyway,
so who cares?
Another option is to use http://php.net/uniqid and you can create a
UNIQUE INDEX on the column and simply check mysql_errno() to see if
it's 1023 (or is it 2023?) when you insert to see if you
At 11:18 AM -0600 3/21/07, [EMAIL PROTECTED] wrote:
Hello,
I want to add a random unique ID to a Mysql table. Collisions
are unlikely but possible so to handle those cases I'd like to
regenerate the random ID until there is no collision and only
then add my row. Any suggestions for a newbie as
2007. 03. 22, csütörtök keltezéssel 11.24-kor tedd ezt írta:
At 11:18 AM -0600 3/21/07, [EMAIL PROTECTED] wrote:
Hello,
I want to add a random unique ID to a Mysql table. Collisions
are unlikely but possible so to handle those cases I'd like to
regenerate the random ID until there is no
At 4:28 PM +0100 3/22/07, Németh Zoltán wrote:
2007. 03. 22, csütörtök keltezéssel 11.24-kor tedd ezt írta:
At 11:18 AM -0600 3/21/07, [EMAIL PROTECTED] wrote:
Hello,
I want to add a random unique ID to a Mysql table. Collisions
are unlikely but possible so to handle those cases I'd like
2007. 03. 22, csütörtök keltezéssel 11.42-kor tedd ezt írta:
At 4:28 PM +0100 3/22/07, Németh Zoltán wrote:
2007. 03. 22, csütörtök keltezéssel 11.24-kor tedd ezt írta:
At 11:18 AM -0600 3/21/07, [EMAIL PROTECTED] wrote:
Hello,
I want to add a random unique ID to a Mysql table.
At 4:53 PM +0100 3/22/07, Németh Zoltán wrote:
2007. 03. 22, csütörtök keltezéssel 11.42-kor tedd ezt írta:
As for efficiency, that's probably not even worth mentioning in this case.
why not? you would use 2 sql queries while I would use one most of the
time and 2 in case of already reserved
2007. 03. 22, csütörtök keltezéssel 12.58-kor tedd ezt írta:
At 4:53 PM +0100 3/22/07, Németh Zoltán wrote:
2007. 03. 22, csütörtök keltezéssel 11.42-kor tedd ezt írta:
As for efficiency, that's probably not even worth mentioning in this
case.
why not? you would use 2 sql queries
Hello,
I want to add a random unique ID to a Mysql table. Collisions
are unlikely but possible so to handle those cases I'd like to
regenerate the random ID until there is no collision and only
then add my row. Any suggestions for a newbie as to the right
way to go about doing this?
Best,
[EMAIL PROTECTED] wrote:
I want to add a random unique ID to a Mysql table. Collisions
are unlikely but possible so to handle those cases I'd like to
regenerate the random ID until there is no collision and only
then add my row. Any suggestions for a newbie as to the right
way to go about
function GenerateID ()
{
$len = 3;
$base='ABCDEFGHKLMNOPQRSTWXYZ';
$max=strlen($base)-1;
$activatecode='';
mt_srand((double)microtime()*100);
while (strlen($activatecode)$len+1)$activatecode.=$base{mt_rand(0,$max)};
$len = 7;
$base='1234567890';
$max=strlen($base)-1;
Ok ... previous problem sorted ... now onto the next ...
The client wants the following;
A scroll bar with 3 random thumbs from each subdirectory in the /images/
folder
I was thinking ...
Going into each folder, getting files, pushing into an array - shuffling
array, taking first three items
On 12/22/06, Steven Macintyre [EMAIL PROTECTED] wrote:
Ok ... previous problem sorted ... now onto the next ...
The client wants the following;
A scroll bar with 3 random thumbs from each subdirectory in the /images/
folder
I was thinking ...
Going into each folder, getting files, pushing
At 11:20 PM +0100 12/3/06, Gustav Wiberg wrote:
Hi there!
I have created a script the generates random pictures...
-snip-
With this above script the same picture can be shown twice. Is there
any smart way of avoiding this without having to rely on
cookies/sessionids?
Random does mean it
- Original Message -
From: tedd [EMAIL PROTECTED]
To: Gustav Wiberg [EMAIL PROTECTED]; PHP General
php-general@lists.php.net
Sent: Monday, December 04, 2006 4:15 PM
Subject: Re: [PHP] Random pictures - not twice
At 11:20 PM +0100 12/3/06, Gustav Wiberg wrote:
Hi there!
I have
Hi there!
I have created a script the generates random pictures...
?php
//Random pictures
//
$pictures[0] = bil1.gif;
$pictures[1] = bil2.gif;
$pictures[2] = bil3.gif;
$pictures[3] = bil4.gif;
for ($i=0;$i3;$i++) {
$r = rand(0,3);
?
pnbsp;nbsp;img src=?php echo $pictures[$r];?/p
?php
user you need.
Let us know what solution you come up with. I'm sure others have had similar
questions and just havn't asked.
-TG
= = = Original message = = =
Hi there!
I have created a script the generates random pictures...
?php
//Random pictures
//
$pictures[0] = bil1.gif;
$pictures[1
- Original Message -
From: [EMAIL PROTECTED]
To: php-general@lists.php.net
Cc: [EMAIL PROTECTED]
Sent: Sunday, December 03, 2006 11:52 PM
Subject: Re: [PHP] Random pictures - not twice
Without using cookies or session information, you're going to go through
your picture list faster
You have an array of names and you want to choose a random name. is it?
try thinking some thing about arrays, keys numbers, key count, and such
Ross wrote:
Hi,
I want to randomise a string
$myrandom = rand(ross, andrea);
echo $myrandom;
I know this doesn't work but is there
Hi,
I want to randomise a string
$myrandom = rand(ross, andrea);
echo $myrandom;
I know this doesn't work but is there a built in function to do this?
R.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi,
I want to randomise a string
$myrandom = rand(ross, andrea);
echo $myrandom;
I know this doesn't work but is there a built in function to do this?
R.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 10/17/06, Ross [EMAIL PROTECTED] wrote:
Hi,
I want to randomise a string
$myrandom = rand(ross, andrea);
I suggest :
$array_name = array(rose,andrea);
$myrandom = array_rand($array_name);
echo $myrandom[0];
Brice.
I know this doesn't work but is there a built in function to do this?
On Tue, October 17, 2006 7:30 am, Ross wrote:
I want to randomise a string
$myrandom = rand(ross, andrea);
echo $myrandom;
I know this doesn't work but is there a built in function to do this?
I'm not real clear on what this is...
Choose a string at random from an array?
$possibles =
I have an ini file that has:
1 = words;
2 = words1;
3 = words3;
I want to pull a rand value and print it out
I'm trying to use parse_ini_file but its not working any help would
be great.
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
I have an ini file that has:
1 = words;
2 = words1;
3 = words3;
I want to pull a rand value and print it out
I'm trying to use parse_ini_file but its not working any help would
be great.
Thanks
You could read them all into an array then use array_rand() to pick one.
Paul Scott wrote:
On Thu, 2006-03-09 at 16:05 +1100, Chris wrote:
What's the whole error message (ie context)? Is it coming from cron or
randomly in your scripts?
From Xdebug...
Its random. I am just thinking though that what it *might* be is that
the initial session is timing out
On Fri, 2006-03-10 at 10:26 +1100, Chris wrote:
If you leave your browser open for 20 mins or something and then try to
log in, does that replicate it?
Ah hah! The plot thickens!
It seems that I can:
1. Launch the app - thereby starting the initial session
2. Leave the session to time out
Paul Scott wrote:
On Fri, 2006-03-10 at 10:26 +1100, Chris wrote:
If you leave your browser open for 20 mins or something and then try to
log in, does that replicate it?
Ah hah! The plot thickens!
It seems that I can:
1. Launch the app - thereby starting the initial session
2. Leave
On Fri, 2006-03-10 at 16:00 +1100, Chris wrote:
If you can produce a small test case might be time for a bug report. It
shouldn't give you permission denied errors.
Will work on it over the weekend. I am going to try something dead
simple with the session stuff and see what I can do with it.
I am pretty much randomly getting the following error:
.. ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission
denied (13) in ...
As far as I can see the session write directory has no problems with
permissions. The *really* strange thing is that it only fails at certain
times,
Paul Scott wrote:
I am pretty much randomly getting the following error:
.. ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission
denied (13) in ...
As far as I can see the session write directory has no problems with
permissions. The *really* strange thing is that it only fails
On Thu, 2006-03-09 at 16:05 +1100, Chris wrote:
What's the whole error message (ie context)? Is it coming from cron or
randomly in your scripts?
From Xdebug...
Its random. I am just thinking though that what it *might* be is that
the initial session is timing out between the app launch and
($retrieved);
$max--;
}
Guarentees unique choices.
I'm still very green with PHP, but am working to fix that.
I've searched high and low for an answer to this question
and so far
no solution has presented itself. I have a script to
populate my web
page with random images:
?php
with PHP, but am working to fix that.
I've searched high and low for an answer to this question
and so far
no solution has presented itself. I have a script to
populate my web
page with random images:
?php
#random images example
#this is your file
$file = images.txt;
#open
Jared Williams wrote:
Hi,
Just unset the ones you've picked
?php
#random images example
#this is your file
$file = images.txt;
#open the file
$openFile = file($file);
#generate a random number
srand((double)microtime()*100);
#get one of the entries in the file
for ($i = 0
1 - 100 of 301 matches
Mail list logo