Wednesday, October 12, 2011
A very useful function that can be used to calculate distance between two points using latitude and longitude values. $unit parameter can be passed to get return in miles, kilometers, or nautical miles. How to use: Another function:
Continue reading...Wednesday, September 7, 2011
Following PHP script uses CURL to login into a Joomla 1.5 website to access private pages.
Continue reading...Monday, September 5, 2011
PHP comes with a ZipArchive class that lets us create and manipulate .zip files. Creating a Zip file using PHP Following code will create master.zip with files containing master.css, new.css, layout.css Extracting a Zip file using PHP
Continue reading...Sunday, September 4, 2011
On my Ubuntu 4.9 with PHP Version 5.3.2-1 I had to install Magento that required myscrypt. To install it, I followed following steps: Sometimes you might get the message “php5-mcrypt is already the newest version“. If so, install with:
Continue reading...Friday, August 26, 2011
While developing a twitter extension I came across following warning message on my Ubuntu development server. After doing some research I found that curl follow location option tells curl to follow a redirect header or not. If the environment in the php.ini is running php in safe mode or an open base dir is set, [...]
Continue reading...Thursday, August 25, 2011
I needed CURL to test some php scripts on WAMP Local Server where CURL is disabled by default. To enable it under WAMP running on a Windows Environment follow these steps.
Continue reading...Wednesday, August 24, 2011
Joomla’s JLog class enables to create log files with useful debug info and other log messages. Following is the PHP code that can be used to log messages.
Continue reading...Wednesday, March 2, 2011
Following function will generate id’s/keys without using MD5 or SHA1. PHP function uniqid() to generate Unique ID’s. It will create prefixed unique identifier based on current time in microseconds. This function will return (13 + prefix length) characters long identifier. If ‘lcg’ is true then it will return (prefix length + 23) characters. This function [...]
Continue reading...Tuesday, September 21, 2010
Following are various functions to find domain name in URL using PHP. Regex Method:
Continue reading...
Wednesday, October 12, 2011
0 Comments