php

Posts Tagged ‘php’

Here’s a quick bit of code I put together to read a UK postcode and spit out the various sections; the city identifier, the area and then the final street identifier: $pcarr = explode(‘ ‘, $this->input->post(‘companyPostcode’)); $pc0 = $pcarr[0]; if(is_numeric(substr($pc0, 1,1))){ $pca = substr($pc0, 0,1); } else { $pca = substr($pc0, 0,2); } // $pca [...]

Continue Reading -»

Leeds Guide website development

I developed additional functionality for both the front end and back end of the Leeds Guide website, using XHTML, PHP (Codeigniter) and Jquery and custom Javascript to enhance the UI.

Continue Reading -»

Here’s some code which allows you to calculate the distance in miles, kilometres or nautical miles between two sets of coordinates: [code lang="js"]/* Function Name: distance() Function Description: Calculates the distance between two sets of coordinates. @Author: Adam Williams <adam.williams@awdigital.eu> @License: Creative Commons Attribution-Share Alike 2.0 UK: England & Wales - http://creativecommons.org/licenses/by-sa/2.0/uk/ @Example: distance(53.61857936489517, -1.4501953125, [...]

Continue Reading -»

You can set the error reporting level in PHP and also define whether it is displayed to the user or saved to a log file. The level can be defined either in the php.ini, .htaccess or directly inside a PHP script. The logging level options are: E_ALL – will log every error, including notice messages [...]

Continue Reading -»