April 2012

PHP Getting the last xx bytes of a large text file

Sometimes the text files are very large and you don’t want to load it in memory before searching through it because it’s inefficient. You just want to get the last few bytes of the file because the latest additions / updates are there. This would help you: $fp = fopen(‘somefile.txt’, ‘r’); fseek($fp, -50, SEEK_END); // …

PHP Getting the last xx bytes of a large text file Read More »

PHP Class for Handling .htpasswd and .htgroup (Member Login & User Management)

Apache is a marvelous web server that offers .htpasswd and .htgroup for controlling restricted access to your website. By help of .htaccess, they work as a member login & user management system that is so simple and easy to deploy. You can even define user groups / roles with it. Basically, .htpasswd defines pairs of …

PHP Class for Handling .htpasswd and .htgroup (Member Login & User Management) Read More »

Scroll to Top