You are here: Re: Random BGSOUND script « All PHP « IT news, forums, messages
Re: Random BGSOUND script

Posted by floortje on 09/27/57 12:00

Fred Atkinson wrote:
> I've written a PHP script that randomly selects a sound file
> to play for the BGSOUND tag.
....

> The problem is that when I test it, it seems to favor the
> first and the last sound file and rarely plays the second one.

Are you sure ??

> Is there a better way to make the random number selection more
> evenly distributed?

$array = array("sound_1.wav","sound_2.wav","sound_3.wav");

echo '<bgsound src="'.$array[floor(rand(0,(count($array)*100))/100)].'">';



Arjen

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация