Sitemap
Coding 101

Short guides to coding languages

Member-only story

PHP 101

--

Press enter or click to view image in full size
Photo by Ben Griffiths on Unsplash

This article will be covering the fundamentals of PHP. You will learn how to use the php syntax, and afterwards be able to learn more php.

PHP has been around since 1994 and is the server scripting language used by companies such as Wordpress, Slack and Etsy. In fact PHP can be found in over 75% of webpages and is a powerful tool for creating interactive and dynamic webpages. Although more recent alternatives are giving it some competition PHP is a handy language to learn to be versatile in the industry.

Let’s start at the beginning…

PHP can either be written inline within a HTML script or contained in a separate file and linked back into the HTML.

If you only require a short snippet of PHP script then all that is required is to write your PHP code in between an opening and closing tag within the HTML file as follows:

<?php
//insert your code here

When an independent “.php” file is being created, you will first need to link to the file from within your HTML document. This is done by adding a line of PHP script and using the “include” keyword:

<?php
//this will include the code into your document
include 'my_file.php';

Then in the file itself start with an opening tag before entering in all your code. The closing tag is not…

--

--

Viktor Jensen
Viktor Jensen

Written by Viktor Jensen

print("please follow along for more content"); writeMoreContent();