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 pt36 on 09/06/07 15:26

Ok Rik
thanks for your help, but please tell me why this work
<?php
$string = "uno.jpg due.jpg tre.gif quattro.gif cinque.jpg";
$array = explode(' ', $string);
shuffle($array);
$string = implode(' ', $array);
echo $string ;
?>

and this not work
<?php
if ($handle = opendir('banner/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$file = $file . " ";
$array = explode(' ', $file);
shuffle($array);
$file = implode(' ', $array);
echo $file;
} }
closedir($handle);
}
?>

 

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

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