Zip files using PHP without the PHP zip function: PHP Zip Class

22nd August 2009 • 64 Comments

The search for a PHP class to zip files has taken me well over 2 years. Going from not being able to find ANY to being able to find some that worked but wouldn’t unzip on MAC, the search seemed as if it would go on forever. A lot of web hosts don’t have the PHP zip function installed yet creating zip’s is quite important and handy to a lot of project. Today my search is finally over and I have finally found an easy + working PHP class for zipping files.

(more…)

Read More

Correctly formatted numbers and rounding in PHP.

20th April 2009 • No Comments

Another little simple thing I’ve come across. After developing several online stores, the PHP round() function removes zeroes from the end of it’s round if you round to the second decimal point. This is fine but if you have a shopping cart you generally want to keep 2 zeroes on the end. This is easily done with a another PHP function.

(more…)

Read More

Parsing global variables through a function in PHP

9th February 2009 • No Comments

I used to think that all variables in PHP went through functions as normal. It wasn’t until I actually needed to read a global variable from a function that I realised it only has it’s own local variables. Having said that, if you need to use variables from outside of a function it is easy enough to parse through global variables.

(more…)

Read More

Speed up your websites using gzip and merging files.

20th October 2008 • 38 Comments

Many sites these days are using more and more Javascript and CSS which can quickly slow the websites loading speed. Gzip compression for your Javascript and CSS is not used in enough websites these days as many people still fear incompatibility with browsers. However this is no longer the case as all modern browsers are now compatible with it. There are heaps of ways to Gzip, none of which I could get to work on my web host, so I created my own which uses the zlib extension in php. I also included a few advantages to it such as merging of files which helps decrease the loading time even more.

(more…)

Read More