Getting Started

So, what did I do to get started with PHP. Well, I began with a Windows 7 laptop, which is probably not where most people start! it is probably easier with Linux.

There is a handy intro video at PHP FOR BEGINNERS - Introduction - YouTube which explains how to get started and there are other videos on the channel for general setup.

String Concatenation

There are two ways to concatenate strings, you can use the concatenation operator or a printf function. The following example shows how these work with both strings and mixing strings and integers:

$partone = 'Hello ';
$parttwo = 'World ';
$output = $partone . $parttwo
$output = sprintf('%s%s', $partone, $parttwo)
$numone = 42;
$output = $output . $numone // $output .= $numone
$output = sprintf('%s%d', $output, $numone)

The documentation for this can be found at PHP: String Operators - Manual and PHP: sprintf - Manual.