Reply to Php random text code to work in version 5

Your name:

Reply:


Posted by chris.huh on 11/14/06 20:43

I have a bit of code i got from a site a while ago. I notice now that
the script does not work on my local machine running php5 but does work
on my hosting server with php4 on it so i am guessing it is somethign
to do with that.

The code is:

<?
$textfile ="random.txt";
$items = file("$textfile");
$item = rand(0, sizeof($items)-1);
echo $items[$item];
?>

Does anything think that it is because of the versions and if it is how
to fix it?

Thanks

[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

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