Category Archives: PHP and web

PHP Tutorial: Variables

A variable is a way of storing information, allowing it to be reused multiple times. Think of it like algebra, only a variable can be assigned a string made up of any alpha-numeric or punctuation characters. A variable is defined in the following form: (more…)

Posted in PHP and web | Leave a comment

PHP Tutorial: Prerequisites and basic syntax

(more…)

Posted in PHP and web | 1 Comment

PHP Tutorial: What is PHP?

I guess I should start with the obvious: What is PHP? (more…)

Posted in PHP and web | Leave a comment

PHP variable variables

Let’s start with “the norm”. This is how you’d normally declare and assign a value to a variable: (more…)

Posted in PHP and web | Leave a comment

[UPDATED] Inserting array values into MySQL table

Trying to work out how to do this has been quite tricky, so I thought it’d be worth documenting my solution, both for other people and my own later needs. (more…)

Posted in PHP and web | 2 Comments

Create MySQL table with variable name

Apparently people have a lot of trouble trying to work how to create a table with MySQL whose name is variable. It’s not the most common thing to want to do, which is probably why not many people can actually answer it. I’ll admit, I was stumped for a while until I worked it out, but the solution couldn’t be simpler. There’s no need to bother with reams of obscure PHP- all you do is use curly braces! (more…)

Posted in PHP and web | Leave a comment

Basic cURL syntax

In its most basic form, cURL is incredibly easy to use. Take the following code as an example- it simply displays the contents of the page example.com. (more…)

Posted in PHP and web | Leave a comment

Displaying two-dimensional arrays as table

Here’s a simple method for displaying a two-dimensional array as an HTML table: (more…)

Posted in PHP and web | Leave a comment

Enabling cURL in XAMPP

cURL comes pre-installed with PHP on XAMPP- you just need to enable it before you can use it.  Find the php.ini file in xampp/php and uncomment (remove the semi-colon from the start) the following line: (more…)

Posted in PHP and web | Leave a comment

XAMPP: Apache dev environment

Apache is known for its functionality, speed and above all, popularity- over 54% of all websites on the Internet are served by it. However it’s not the easiest thing to set up and get running. (more…)

Posted in PHP and web | Leave a comment