|
Posted by guttyguppy on 03/06/06 06:11
<?php
I did this, and it works. I'm not sure why though, I worked at it for a
long time and got lucky. Can anyone tell me if they see anything
inherently wrong with it? It works so hey I'm not complaining...
$fp = fopen('filename.txt', 'r');
$random = rand() % 3663782;
fseek($fp, $random);
if (!fgets($fp)) {
$data=fgets($fp);
echo $data;
}
else {
echo fgets($fp);
}
?>
Navigation:
[Reply to this message]
|