Automatically Detect Browser Language With PHP

When you are working on a multi national website you may need the functionality to translate your website into different languages. There are many ways you can translate a website, in this article I w...

Resize Image Class With PHP

A common feature that you will across in websites is the ability to resize an image to fit an exact size so that it will displayed correctly on your design. If you have a very large image and you are...

Formatted Strings With PHP

When you are using PHP to putput a string on the page most of the time you will use the syntax echo, which will take the following string and display that string in HTML. You can even concaternate mul...

Encode Email Addresses With PHP

Spam bots will crawl your pages exactly the same way Search Engines crawls your pages, but while Search Engines are crawling to index your content, spam bots are crawling to find certain information....

Namespaces With PHP

PHP namespaces was introduced in version 5.3. Namespaces is a way of group classes together into virtual directories, the main reason we would want to do this is to help avoid collision of class names...

Dependency Injection With Test Driven Development

With unit tests you can check that your code behaviours just as you expect it to. When writing your unit tests you shouldn't need to worry about if any other area of the application is working correct...

Test Driven Development With PHP

In a previous post I wrote about the benefits of using Test Driven Development in your application development process. This can be used in all types of development from software to web to front-end t...

Test Driven Development

In this post we will be investigating what is test driven development and how we can use it to improve our development process. What Is Test Driven Development? Test driven development is a developmen...

Difference Between PHP Include And Require

One of the most common questions I get asked by PHP beginners is, Why is there 4 ways to include a file on your page? There is include(), include_once(), require() and require_once(). What do these do...

Disable HTTP Cache With PHP

HTTP Caching can be an important feature for websites it will allow your browser to cache your web elements that your page will collect via HTTP. When HTTP caching is turned on your web pages will loa...

How To Use PHP To Get Visitors Browser

With the raise of popularity in using mobile devices to access websites, web designers need to start designing their websites so it can be used correctly on a mobile device. There are several ways you...

Get The File Extension In PHP

Getting a file extensions from a PHP string is an important task on validating a file for a upload. For example if you have a file uploader which you only want to use for image uploads then you need...

Parse URL Querystring Into Array In PHP

Using query strings in PHP is a good way of transferring data from one file to another. This is done by using the $_GET variable. This variable is a global variable that is used to get the content of...

Get Current URL With PHP

Use the below PHP snippet to construct the current page URL. It will find out if the URL is on a secure URL or not, gets the server name and port number if needed and the current page. function...

Easily Create A Table In PHP

Here is a small PHP snippet to easily create a table in PHP. First create the draw_table function.