Posted by J.O. Aho on 11/14/06 21:39
chris.huh wrote:
> 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?
PHP 5.1.6 (cli) (built: Oct 12 2006 17:00:51)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
No trouble at all with the unmodified small script, just your local php that
must be broken somehow.
//Aho
Navigation:
[Reply to this message]
|