Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having trouble with arrays.
#3
(09-17-2010, 01:17 AM)Omniscient Wrote: echo (array_rand($employee_array,1));

That should work.

Oh fudge. I've been doing it the hard way.

PHP Code:
$count count($arr) - 1;
$rand rand(0$count);
echo 
$arr[$rand]; 
Reply


Messages In This Thread
RE: Having trouble with arrays. - by Omniscient - 09-17-2010, 01:17 AM
RE: Having trouble with arrays. - by Orgy - 10-06-2010, 01:51 PM
RE: Having trouble with arrays. - by ariton - 10-08-2010, 03:51 AM
RE: Having trouble with arrays. - by Orgy - 10-08-2010, 04:35 AM
RE: Having trouble with arrays. - by Disease - 10-08-2010, 04:46 AM
RE: Having trouble with arrays. - by Orgy - 10-08-2010, 06:13 AM
RE: Having trouble with arrays. - by Zankza - 10-08-2010, 03:27 AM
RE: Having trouble with arrays. - by Chimi - 12-06-2010, 01:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  apache trouble Socrates 9 1,500 11-09-2009, 08:15 PM
Last Post: Socrates

Forum Jump:


Users browsing this thread: 1 Guest(s)