I have about 300 lines of text that need to be echoed randomly.
Here's my current code:
<?php
$lines = array(
'Line 1',
'Line 2',
'Line 3'
);
$powered = echo $lines[rand(0, count($lines)-1)];
echo $powered;
?>
I know that the issue is probably with line 9 because I'm not sure how to assign the echoing to a variable. I need to be able to include this file in several others and echo $powered
to get a random line.
Any help would be really appreciated.