Taun ini lumayan banyak ngoding sendiri (walaupun cm minor changes), but it’s fun and challenging! Asik juga ternyata cari-cari error dan ada kepuasan tersendiri pas berhasil menemukan di mana letak error tsb (norak ya, padahal kadang2 cm simple things). Masih ingat post sebelumnya? Sampai sekarang kalau coding ya paling seputar PHP & C#. For the latter, if I could choose, I want to use VB.NET. Sayangnya, gw gak bisa milih. 😛 Continue reading
Because I can forget things easily if I don’t use it often and I’m sure this will be used again in the future, I should make a note about it.
Getting certain year using this method is very useful when we make a dynamic application, like in registration form in which we want to limit the age of the registrants, we can use this.
- To get current year: date(‘Y’);
- To get previous year: date(‘Y’, strtotime(‘-1 year’));
- To get next year: date(‘Y’, strtotime(+1 year’));
If you want to get last two year or the next two year, just change -1 to -2 or +1 to +2
Well, actually, you can use this PHP script to download other type of files.
Yesterday, I just realized that if we upload .TXT file to our hosting and try to download it later, the content of the TXT files will be listed in our browsers directly. So far, I never needed to download any txt files, so I never paid attention to it. Continue reading