Past Tutorials PHP

Strings in variables.

In the previous article we discussed the basics of variables. Now we’ll get a little more in depth and touch on storing a string or multiple strings in variables.

So what is a string?

A string is simply a string of characters or words. It can be anything from a few words to an entire paragraph. I’m pretty sure you remembered this from our previous entry:


$container = ‘Knight Rider, A shadowy flight into the dangerous world of a man who does not exist. Michael Knight, a young loner on a crusade to champion the cause of the innocent, the helpless, the powerless, in the world of criminals who operate above the law…’;


The opening narration for Knight Rider is simply a “string” in programming terms. A variable storing a string can be used for multiple purposes, such as outputting and for use in functions and conditions, which we’ll get into a little later.