PHP For The Web: Enough to be Dangerous
2022
1 Introduction and Prerequisites
Howdy!
This is going to be a very brief but hopefully very helpful text for beginners. I chose PHP because it is a great language to get up and running with. WordPress and Laravel are great options for the web, and PHP is a robust language on its own.
Don’t just read along. Try things out. Never copy and paste the example code. Write it yourself and make it your own. I’ll try to provide helpful loose ends for you to jump into if you feel inspired. I’ll try to make my examples varied and show different possible applications. Math is inevitable. Sorry. This is a gentle text that requires very little prior knowledge of mathematics. In other words: you definitely don’t need calculus for this text. This text is written to gradually introduce programming concepts as scaffolding before exploring more complex examples.
I encourage you to use the terminal. If you’re running Windows, I would suggest setting up the Windows Linux Subsystem. If you’re running Mac OS, you’ve already got a terminal. Linux is my preference, but you can jump into this material from any OS.
Commands for the terminal will have a “>” character at the beginning. If you’re unfamiliar with using the terminal, you’ll find some helpful commands to get started below.
>ls
: list all the documents in your current directory
>cd
: change directory
>php -a
: start an interactive PHP shell
>man
: retrieve a manual for using a command
It is customary to suggest that you start by reading the manual on the manual command. You can do this by running >man man
in your terminal.