News & Blog

Getting the Time a PHP Script Takes to Execute

July 20th, 2011 - Posted by Steve Marks to PHP, Web Development.
If your working with large resource intensive PHP scripts, or are simply looking to refine and optimize an existing bit of code, one of the steps you might take is to look at how long your PHP code is taking to run. We can do this within the PHP code itself by analyzing the time [...]...

Looping Through an FTP Directory Using PHP

July 13th, 2011 - Posted by Steve Marks to PHP, Web Development.
If you’re a website developer you’ll probably have countless hours of experience using FTP, from putting sites live, renaming files, deleting files and more. This is made easy through using an FTP client installed on your machine. The process can also be just as simple by using...

CodeIgniter Google Static Maps V2 API Library

July 5th, 2011 - Posted by Steve Marks to PHP, Web Development.
The standard Google Maps JavaScript API is great for making fully functional, interactive maps. A lot of people don’t know however that Google also provide an API for generating static maps in the form of a normal image. This is great if you don’t need all the advanced features...

Generating a Dynamic XML or Text Playlist using PHP

June 5th, 2011 - Posted by Steve Marks to Flash, PHP, Web Development.
If you’ve ever tried to incorporate some kind of Flash music player into your website, you’ll probably notice that it will more than likely contain an option to use a playlist to play multiple songs in sequence. This can work really well if you’ve got a set number of song...

Tumblr API CodeIgniter Library

May 31st, 2011 - Posted by Steve Marks to PHP, Web Development.
Over the past few years Tumblr has put up a good battle against other blogging platforms and still stands strong against the likes of WordPress and Blogger. Not wanting to be narrow-minded I decided to take a look into Tumblr and was actually very impressed. I don’t think I would con...

Converting a PHP Array to a Query String… And Back Again

May 18th, 2011 - Posted by Steve Marks to PHP, Web Development.
This is a scenario I have found myself in many times before; needing to convert a PHP array to a query string for use in a URL or POST request, and vice versa. Today I will discuss both methods and how they can be achieved with the aid of two very useful PHP functions; http_build_query() [...

CodeIgniter MailChimp 1.3 API Library

May 15th, 2011 - Posted by Steve Marks to PHP, Web Development.
There are lots of email marketing applications out there nowadays but by far my favourite is MailChimp. Alongside its strong use of AJAX to build an easy-to-use interface and its witty banter displayed throughout, it also has a great API allowing third parties to integrate with MailChimp a...

Using PHP to Capitalize a Word or Sentence

May 15th, 2011 - Posted by Steve Marks to PHP, Web Development.
If you’re the webmaster of a site that gathers user’s information you’ll probably know all too well that user input can be, to put it blutently, a bit sloppy. This isn’t a problem as such, but can look a bit improper when this information is shared or displayed to o...

Echoing New Lines in JavaScript Alert Box Using PHP

May 5th, 2011 - Posted by Steve Marks to Javascript / jQuery, PHP, Web Development.
Alert boxes in JavaScript provide a useful way to show the user an error, message or prompt. Adding new lines to one of these alert boxes can be done like so: alert("This is line one\nThis is line two"); The above bit of JavaScript would output the following: Reproducing With PHP At first ...

Converting PHP print_r() Output to a String Variable

April 4th, 2011 - Posted by Steve Marks to PHP, Web Development.
The PHP function print_r() is great at outputting a variable in a human-readable format. What if we don’t want it to print to the screen however and instead, for example, want to include it’s output in an email? The Solution You might be suprised to learn that you don’t n...