Wanna be 1337? Read Penguin Pete!

Random tagline display PHP hack

Date/Time Permalink: 04/13/06 04:27:41 am
Category: HOWTOs and Guides

<?php 
global $Taglinecount;
$Taglinelist=file('http://www.yoursite.com/your_taglines');
$Taglinecount=0;
foreach($Taglinelist as $Tagline)
{ $Taglinecount++; }
echo $Taglinelist[rand(0,($Taglinecount-1))];
?>

Replace "yoursite.com/your_taglines" with your own site's tagline list, of course. The taglines will need to be in a simple text file, and one-liners only, as PHP's file function will read the file in as an array with one element per line. Paste this in wherever you need your random quotes!

And to think only a month ago I was groaning about having to learn this language!

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

suddenly the moon