in IT stuff, PHP, Programming

Wer hat den kürzesten?Who has the smallest?

Gemeint ist natürlich der kürzeste PHP Code, der ein rudimentären Blogging-System ermöglicht. Der bisherige offizielle Rekord liegt bei 138 Bytes von Fabian, mein Code liegt bei aktuell 93 BytesOf course I am talking about PHP code. PHPgangsta started the “Who can code the smallest blogging system?“-contest. The currently smallest code from Fabian has a size of 138 Byte, the version I am working on needs 93 Byte of disk space. Who will make it?

Die Bedingungen: Ein autorisierter Administrator muss die Möglichkeit haben, Beiträge mit Titel, Timestamp und natürlich Content auf einer Seite auszugeben. Dort sollen die Beiträge chronologisch angezeigt werden.

Hier ist mein Code (Zeilenumbrüche nur zur besseren Übersicht):

<?
$g=$_GET;
$p='<p>';
if($g[p]==$p)
fwrite(fopen(a,a),$p.time().$p.$g[t].$p.$g1);
include(a);
?>

Update: Klicke hier für das Ergebnis ;)

The must-haves:

  • an authorised author can write a post with a title and timestamp
  • the main page shows the posts in chronological order

This is my code (the breaks are just for better understanding and can be removed):

<?
$g=$_GET;
$p='<p>';
if($g[p]==$p)
fwrite(fopen(a,a),$p.time().$p.$g[t].$p.$g1);
include(a);
?>

I am excited who will win :)

UPDATE: The result

Write a Comment

Comment