PHP is the language of WordPress. Moreover, it’s what Facebook uses to generate its website.
As one of the most popular technologies used to build the web, understanding how it works will go a long way to understanding the web itself.
Now, what can a digital marketer like you get out of a PHP primer like this one?
Well, as a marketer, you may never get to write complex programs.
Even a basic knowledge of PHP will help position your brand for success as you integrate more sophisticated technologies into your marketing campaign.
PHP is a programming language (more on this later). There are many ways of explaining a programming language.
One is going through all the interfaces one will encounter on screen when performing some task. By detailing step-by-step what to browse to, click on, download and type; you get practical experience in problem solving (though not much understanding).
Another approach focuses on logic. Typically, this is what you’ll see if you read articles on the web or in books.
Most people who try to explain computers to a lay audience have a computer science background from a university, and at universities everything is about mathematics and generalities.
It has a very pure, symbolic approach, which is far from real situations. Dividing straight into the semantics and structures of the code is tantamount to this approach.
It’s worth understanding the logic that underpins code if only for self-education, but in my experience it’s not anything like as important as it’s made out to be.
Another popular approach is systems.
These are the common mechanisms and standards that make up the bulk of computing. Reading about these can easily make one feel overwhelmed.
The number of systems vying for relevance in the tech world is practically endless and constantly growing. Anyone with a keyboard and some software experience tried to reinvent everything from the ground up.
And, many do just that, standing on soap boxes trying to convince everyone that their new system is best.
What’s important is appreciating that systems are numerous and fickle and are each simply a set of standard practices described in the manual.
Systems come and go. Some are stable, though, and worth studying.
A good example of this is UNIX, the standards on which Linux is based. It’s been around for decades and every indication is that it will be relevant for decades to come.
What Does It All Mean?
All of these – interfaces, logic and systems – provide knowledge and perspectives which help develop understanding and the ability to design solutions and to diagnose issues.
Each is a framework for seeing what a programming language is and the context in which it exists. It’s worth going through each of these.
But first, let’s start with a timeline of events:
1. A person types facebook.com into their laptop
2. Within seconds, graphics and text detailing the thoughts and interests of acquaintances appear on the screen
Since PHP is used to build facebook.com somewhere in between these two events PHP is involved.
What’s in a Name
To break this down further we need to talk about the word programming. A program in ancient times blocked out the primary sequence of events of plays or public events for the benefit of the audience.
It was written on a piece of rectangular card or parchment with symbols in combination (i.e. letters and words) used to represent the relevant events. Each were typically numbered or marked with sub-lettering for ease of reference.
This is practically identical to what we mean by a program today. Instead of events representing scenes in a play or performances by an orchestra they are instead actions on a machine. The parchments are called files and the process of creating them is called programming.
Typically several files make up a program. Each is written in various formats which describe the meaning of the lettering and how they are laid out.
These are typically given the heading language hence the term programming language.
The Totality of the Machine
Let me emphasise a point.
I just said that to program a computer you use files.
One insight I found incredibly useful in simplifying my understanding is to recognise how universal this is: what you use to program computers in this day and age is literally just files.
There are some very minor exceptions. (For any techs interested in this, I’m thinking of the bootloader.)
But some time back, the grandfathers of modern computing decided to not only stick with the “files” metaphor, but to make it universal. The driving configuration of your computer and all computers is made up entirely of files.
Know the files; know everything.
There aren’t switches on the side like a hair-drier or levers and knobs to understand like a radio. What makes computers run the way they do is files and only files.
Though there are knobs and buttons and levers to click and drag and set on-screen but this is just a front-end to modifying the files underneath it all.
When people say “The Web” they’re talking about the events we mentioned above: typing facebook.com into your laptop or phone and having information streamed down onto a colour screen.
Like with PHP, to understand the web one can take various approaches. Perhaps the most useful is forming the concept called a web server.
In computing, parlance server comes from the verb to serve. The conceptual model actually involves another actor called the client where the client and server talk to each other over some separation (like the net).
So in our timeline above the client is our laptop and the server is a computer that spits out the contents of facebook.com.
The language of the web is called HTML. This is the format of the files browsers receive that lay out the text and pictures of websites.
It’s worth convincing yourself of this. Using a browser on the desktop you can view source using the developer tools to see the HTML you are looking at.
This happens for every site you are viewing, including facebook.com. HTML is essentially what you are looking at.
And what’s worth noting is that PHP does not appear anywhere.
This is because what is inside the server is a device that takes your PHP site and converts it to HTML before it sends it to the client.
To go further we need to talk about the format of PHP files. These are actually pieces of HTML and PHP code combined.
It is these snippets of code which inscribe the logic we mentioned earlier, as well as the connections to the systems you need to read about in the manual.
And it might also be worth going through step-by-step in putting all of this together.
So stay tuned as we deal with these topics in greater detail in Part 2.