-
Learning PHP – Part 6: Functions
Posted on November 3rd, 2009 No commentsFunctions are a very important PHP feature, and are the building blocks to some very powerful programming techniques. First of all, what is a function?
In the tutorials so far, the PHP scripts have run from the top down. All instructions are performed in the order they appear in the file.
A function can be thought of as a reusable ‘black box’. You (optionally) give it some data (called arguments or parameters), it performs an operation and (optionally) gives you a result.
This is illustrated in the following diagram:

-
Learning PHP – Part 5: Your first dynamic web page
Posted on November 3rd, 2009 No commentsAfter the previous parts of this tutorial, you should be familiar with PHP variables and arrays.
Now we will use these concepts to actually make a working web page. This page will contain a form that you can submit, and we will write PHP code to handle the form contents.
-
Learning PHP – Part 4: Controlling flow
Posted on November 2nd, 2009 No commentsSo now we’ve looked at variables and arrays, it’s time to make the code a little bit smarter.
We’ve already seen how the foreach() can loop (iterate) over items in an array, but there are other ways to alter the flow of the code as well.
Conditional
One of the most common PHP statements is the “if”. In a nutshell, “if” does the following:
if (some condition is true) { run this code }
-
Learning PHP – Part 3: Array basics
Posted on October 26th, 2009 No commentsIn part 2, you were introduced to the concept of variables and the string, integer and floating point types. In part 3 we’ll go through a more advanced type; the array.
-
Learning PHP – Part 2: Variable Basics
Posted on October 25th, 2009 1 commentAfter part 1, you should be familiar with the echo statement, which outputs a string to the browser:
echo 'This is a string';
(Note that from now on the opening (<?php) and closing (?>) PHP tags are omitted from examples, but should still be included in any source code you create)
On its own, it does not appear to be useful; after all we could have just written ‘This is a string’ in HTML for the same effect. The real power comes from using PHP variables.
Read the rest of this entry » -
Learning PHP – Part 1: Introduction
Posted on October 24th, 2009 2 commentsSo, you’ve got to grips with the basics of HTML and CSS, and now you want to actually make your web page do something? Well, PHP is a great way to do that. In this series of blog posts, I will introduce the PHP language and teach many useful techniques that are used in professional PHP development.
-
Step by step: Moving code between Subversion repositories
Posted on July 23rd, 2008 4 commentsAs many coders will tell you, there reaches a point where you realise that you absolutely, positively must keep your code in a a revision control system. In my working life, I’ve used Microsoft’s ageing SourceSafe and more recently the vastly superior SubVersion (SVN).
There’s many powerful GUIs out there which you can use to interact with SVN, and make the checking out and checking in very easy. If you primarily use a desktop GUI (like me), then chances are you use a SVN client GUI to interact with SVN on a day-to-day basis.
But what happens when you need to move code between repositories?



