Quick Challenge - A PHP script in 58 characters.

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Quick Challenge - A PHP script in 58 characters.

Post by onion2k »

I'm going to buy myself a nice new iPod Nano because my old one is a bit wrecked and I need it for mountain biking. They come with free laser engraving on the back .. so I'm thinking of getting a short PHP script on mine! Yes, I am that geeky. :twisted:

So as a little inspiration I figure we should have a little competition (no prizes) to see who can come up with the coolest/silliest/most interesting script that fits in the 58 character limit. Bonus marks for getting it to do something relevant like echo'ing out "This is an iPod" or the URL of PHPDN or something.

If the winning entry is better than anything I can come up with I might well go with it.. your script could be immortalised on the back of a mod's iPod! Amazing!

One more rule - You can't use short tags. I refuse to have them on my iPod. If you need that much space just leave out the opening tag.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Quick Challenge - A PHP script in 58 characters.

Post by pickle »

Code: Select all

<?PHP function lost(){if($found)return(123-4567);} ?> 
There's room to put your area code & another dash in if necessary.

Edit: I use an iPod Shuffle for biking. You don't need the screen, you don't need the capacity, the Shuffle is cheaper, and it comes with a built-in clip for clipping to your shorts or backpack.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Quick Challenge - A PHP script in 58 characters.

Post by onion2k »

Nice. I like that.

EDIT: Argh. Stupid Apple. I've just discovered they don't allow any of "~*<>\ ... they could have said that before you try to buy.

EDIT 2: I liked your idea so much I went with a version of it... My iPod will say:

Code: Select all

function lost($found){return;
echo('e: xxxx@xxxx.com');}
Technically the function is wrong because it'd always return before the echo gets called, and the parameter isn't used, but it's only for show. I even had to set up a new email address for it to make it fit properly. :lol:
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Quick Challenge - A PHP script in 58 characters.

Post by pickle »

You could take off the opening & closing tags. It wouldn't advertise your PHPetish as well though.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
VirtuosiMedia
Forum Contributor
Posts: 133
Joined: Thu Jun 12, 2008 6:16 pm

Re: Quick Challenge - A PHP script in 58 characters.

Post by VirtuosiMedia »

Code: Select all

<?php
$iShower = $_GET['clean'];
if($iShower){
    echo getdate();
}
?>
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Quick Challenge - A PHP script in 58 characters.

Post by pickle »

No idea how many characters this is - slight modification of ~VirtuosiMedia's snippet:

Code: Select all

<?php
$i->shower = $_GET['clean'];
if($i->shower)
    $i->getdate();
?>
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Quick Challenge - A PHP script in 58 characters.

Post by jayshields »

What about

Code: Select all

 <?php
if($i->shower && $_GET['clean'])
  $i->task = getdate();
?>
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Quick Challenge - A PHP script in 58 characters.

Post by onion2k »

Why are these snippets all about having a shower? Are you lot trying to tell me something?

:?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Quick Challenge - A PHP script in 58 characters.

Post by pickle »

We're not saying anything dude...we're just saying.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
VirtuosiMedia
Forum Contributor
Posts: 133
Joined: Thu Jun 12, 2008 6:16 pm

Re: Quick Challenge - A PHP script in 58 characters.

Post by VirtuosiMedia »

Sorry, that's just my quirky sense of humor.
Post Reply