Reply to Re: sorting random values from a string

Your name:

Reply:


Posted by Rik Wasmus on 09/06/07 13:47

On Thu, 06 Sep 2007 15:39:06 +0200, pt36 <key.alberto@gmail.com> wrote:

> Hi
> I have a php string like this:
> $string =3D "one two three four five"
> I have to sorting the values randomly every time the page are loaded.
> So, for example:
> first time
> "one two three four five"
> second time
> "three five one four two"
> third time
> "five four two one three"
> ...
> The number are a images in a folder and I have to sort these images in=

> a random sequence.
> Thanks for suggestions.


$string =3D "one two three four five";
$array =3D explode(' ', $string);
shuffle($array);
$string =3D implode(' ',$string);
-- =

Rik Wasmus

[Back to original 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

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