perjantai 5. maaliskuuta 2010

My super awesome way of making code

Today I realised that I could save lot's of time and money by making code littlebit differently.

So I decided to make code from filenames, so that I could have in one folder list of files named like echo.php, print.php, mysql_connect.php etc.

So, after many hours of work, I came up with a way that I honestly think will change the PHP community.

$arr = array();
foreach(glob("/directory/*.php") as $file) {
   $file = str_replace(".php", "", $file);
   $arr[] = $file;
}
if(sizeof($arr) > 0) {
   eval(implode(" ", $arr));
}

Ei kommentteja:

Lähetä kommentti