You are here: Re: sorting random values from a string « PHP Programming Language « IT news, forums, messages
Re: sorting random values from a string

Posted by Rik Wasmus on 09/06/07 14:50

On Thu, 06 Sep 2007 15:47:51 +0200, Rik Wasmus =

<luiheidsgoeroe@hotmail.com> wrote:

> 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 i=
n
>> a random sequence.
>> Thanks for suggestions.
>
>
> $string =3D "one two three four five";
> $array =3D explode(' ', $string);
> shuffle($array);
> $string =3D implode(' ',$string);

....ofcourse:
$string =3D implode(' ',$array);




-- =

Rik Wasmus

 

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

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