Skip navigation.

PHP

Simple PHP Shopping Cart Tutorial

This is a very simple shopping cart that stores the product ids in a hash table. The keys are the product id and the values are the quantity of that particular product.

To store information between pages we can use the $_SESSION superglobal variable, by using an element of the array like this: $_SESSION['cart'] - this is where our cart will be stored.

Wrestling with Drupal Breadcrumbs

Since I first installed Drupal I've had issues with the menu system and breadcrumb trails. Out of the box they don't do what I'd expect them to do.

For those who don't know what a breadcrumb trail is: look above this post - it's the links that show you the path from the home page to the current page (it should say "Home > Blog > Wrestling with Drupal Breadcrumbs"). They allow you to move back to the parent pages of the current page easily.

Data Mining with PHP

I took a data mining course during my third year - here's an implementation of the (k-)nearest neighbour algorithm in PHP.

LZW Algorithm in PHP

During my third year at Goldsmiths I studied data compression. Here's my implementation of LZW in PHP.

Syndicate content