[ create a new paste ] login | about

Link: http://codepad.org/cgPLEtr7    [ raw code | output | fork ]

PHP, pasted on Jul 7:
1
2
3
4
5
6
7
8
<?php 
    $year = date('y'); //gets 2 digits of year, ex, year 2014 as 14
    $month = date('m');//gets 2 digits of month, ex, month July as 07
    $day = date('d');//gets 2 digits of date, ex, date 07
    $random = substr( md5(rand()), 0, 4); //generate 4 digits random number using 0-9 and a-z
    $code = $year . $month . $day . $random;
    echo $code;
?>


Output:
1
1407077d78


Create a new paste based on this one


Comments: