Archive for November, 2007

Even More Tips for faster PHP scripts

Hey there! Welcome to Making the Web - my personal blog about website development. Feel free to subscribe to my RSS feed to keep up with the latest. Alternatively, subscribe by email. Hope you enjoy this article!

Following on from "Tips for faster PHP Scripts" and "More Tips for Faster PHP Scripts", I bring you Even More Tips for faster PHP Scripts.

Because I've already talked about the main, general, optimization tips, these ones will tend to be more specific and may not apply to everyone - nonetheless, it's worth a read in case you ever do come across these situations.

Here are tips 11-15:

11. is_numeric() vs. ctype_digit()
To see whether is_numeric() or ctype_digit() is the fastest method, I called each function 10,000,000 times. Here are the resuts:

is_numeric(): 9.943268 seconds
ctype_digit(): 11.801991 seconds
is_numeric() is 15.75% faster than ctype_digit()

It's worth using is_numeric() over ctype_digit() where it's appropriate to do so. Although a difference of 0.0000001858723 may seem small, it does all add up.

__('Read the rest of this entry »')

Comments (24)

Creating a CAPTCHA with PHP

CAPTCHA is the term used for the test to see whether a user is a human or a computer (spam bots…). You may have seen them on a registration form, or when entering comments into a blog.

I spent a while developing a CAPTCHA in PHP with the GD library, and so I thought I'd write an article about how to make one. This is an example of a CAPTCHA using my code:

CAPTCHA

__('Read the rest of this entry »')

Comments (10)

Web Developers' 7 Must-Have Firefox Extensions

Firefox extensions allow you to add great tools to your browser. As a web developer, I've used extensions to assist in developing and testing my websites.

Here is my list of the must have Firefox extensions:

Firebug
This extension is by far my favourite. It allows you to edit pages live, identify JavaScript errors, debug, and more. Download

Web Developer
This adds a toolbar which allows you to disable JavaScript, add and view cookies, edit CSS, view response headers, validate the page, and more. Download

Screengrab!
This extension doesn't really help you develop your site, but it does allow you to save the entire page as an image, which may sometimes be useful. Download

IE Tab
IE Tab allows you to test you sites in Internet Explorer, without actually having to open the application up. Download

ColorZilla
ColorZilla allows you to get the colours from the page. Saves me alot of time, because I no longer have to copy the image into an application like Fireworks, then get the colour. Download

Tamper Data
This allows you to change headers and POST data, which is always useful. Download

Html Validator
Although the Web Developer toolbar allows you to validate pages, I recommend this extension because it shows you live the results of validation in the status bar. Download

If you have any other extensions which you like, feel free to leave a comment.

Comments (4)

Making the Web | Chalvedon School and Sixth Form College | Messenger History | GCSE(WIKI): Simple bitesize revision for secondary school, KS4 students. | Encrypt files for free - high-grade encryption
Who's Populating The Web?