Archive for the ‘tip’ Category

The following is a very short code to read the version number of a PDF document using PHP. I needed this recently during a PDF processing app developed in PHP. As Adobe uses different compression methods in various versions, it becomes necessary to be able to identify the version of the PDF under work.

Frequently one needs to get the last few lines of some log files, whether php error logs or Apache logs. Most of these file sizes run into megabytes, which makes it difficult and time consuming to remotely open them using ftp. If you have shell access then you can easily use the *nix ‘tail’ command [...]

Google Shared Stuff allows one to easily get the Favicon of any website with a single line. For instance to get the Favicon of yahoo.com we can use the following in a browser. http://www.google.com/s2/favicons?domain=yahoo.com We can do do the same using PHP and curl using the following code.

During debugging the majority of my time is spent in searching for specific text. Searching on the local machine is a breeze via a IDE, but if I’ve an application hosted on a remote server then it can get difficult and slow, unless of course you have access to SSH when you can use good-old [...]

Frequently when you are displaying images on a page using a fixed width and height , the images come out stretched or squeezed. This is because the aspect ratio of the images have not been maintained. In such a case you can use the following script to correctly display the images according to the aspect-ratio [...]

Removing blank lines from html and other source files

some essential php command-line options for your use

how to simulate java like import packages in php

quick htaccess file creation on windows