/* PHP & MySQL Journal */
In: algorithms| php
9 Jul 2008The Luhn algorithm also known as the “modulus 10″ or “mod 10″ algorithm, is a checksum formula which can be used to validate credit card numbers. Developed in the 1950’s by IBM scientist Hans Peter Luhn and described in U.S. Patent 2,950,048. A PHP implementation is shown below.
function LuhnCheck($strDigits)
{
$sum = 0;
[...]
In: algorithms| php
24 Jun 2008Data structures are one of the core elements of computer science and they are also fun to program. But being a web developer the opportunity for implementing them in any application is quite rare. But then I thought, What the heck! I can just code for the joy of it, and it will also help [...]
Code tuning is an essential part of programming. But most programmers would rather try to complete the project in hand then spend time optimizing a piece of code. A well tuned and optimized code block can speedup your application by an order of magnitude or even more.
Many people confuse profiling with benchmarking. A profiler is [...]
In: php| visualization
13 May 2008ClickHeat is a wonderful PHP software that lets you add Heatmaps for your webpages. Heatmaps are visual representation of clicks on a HTML page, showing hot and cold click zones. It can be useful to see at a glance which webpage areas are getting the most clicks as this areas get redder in color [...]
In: php
9 May 2008The graphic below displays the market share of each PHP version as on march 2008. The blue graph represents the sum of all preceding versions.
PHP 5.2.5 now is the most popular version of PHP followed closely by PHP 4.4.8 and 4.4.7. This information can be helpful if you are planning on creating an Open source [...]
Most people are familiar with recommendation systems on websites, wherein after you select an item you are presented with a list of similar items other people purchased . Amazon being the popular one and also one of the first to use it. Below is shown a snapshot from Amazon.
Collaborative filtering algorithms work by searching a [...]
PHP is a wonderful dynamic language, and the addition of Unicode support, namespaces in the upcoming version 6 will make it even better.
If you are new to PHP or are thinking of moving to PHP form other language then the following list of books will provide you with the required knowledge to become a seasoned [...]
In: php
19 Apr 2008Due to recent changes made by Google in its Page Rank processing the following library doesn’t work. However you can try to use the following api made available by fusionswift.com:
http://fusionswift.com/201004/google-pagerank-script-in-php/
Mark Woodman has created a nifty class which lets you query Google pagerank info in PHP 5 and above. The complete classes are available here.
The minimum [...]
Zend framework is gaining widespread use everyday. Each new version of the framework includes new component additions. The following shows a visual representation of the Zend framework for version 1.5.
The following image was created using Microsoft Visio and then exported to PDF. I’ll be adding a linked map page soon. Click on the image for [...]
In: php
7 Apr 2008There is a frequent need to post xml data to a url. Below is shown an example which lets you post xml data using CURL.