Learn PHP from basics to building dynamic web pages - syntax, functions, arrays, forms, MySQL, and object-oriented PHP.
What Is PHP and Setting Up XAMPP PHP is a server-side scripting language designed for the web. It generates HTML on the server, so visitors only ever receive the finished page, ...
PHP Basics: Syntax and echo PHP syntax is approachable, mixing HTML and embedded script blocks. echo is the workhorse that prints output. Tags and statements Statements end with a ...
Variables and Data Types PHP variables are loose: you do not declare a type, and the interpreter decides the type from the value you assign. Declaring variables Variables start ...
Control Structures Conditionals and loops direct the flow of your scripts. PHP supports the familiar structures from other C-style languages plus a few template-friendly ...
Arrays and Functions Arrays are PHP's all-purpose collection type, and functions package logic into reusable named blocks. Indexed and associative arrays Indexed arrays use ...
Working with Forms: GET and POST Forms are how users send data to your server. PHP exposes that data through two superglobals: $_GET and $_POST. Building the form The submit loads ...
PHP and MySQL with PDO PDO is PHP's database access layer. It supports multiple database engines and, crucially, prepared statements that stop SQL injection. Connecting The DSN ...
Sessions and Cookies HTTP is stateless, so each request is independent. Cookies and sessions give your app a way to remember users between requests. Cookies A cookie is a small ...
Object-Oriented PHP PHP supports classes, inheritance, and interfaces. OOP groups data and the methods that act on it into cohesive objects. Classes and objects The constructor ...
Building a Small CRUD App Bring PDO, forms, and functions together in a minimal item manager: create, read, update, and delete records from a MySQL table. The database table ...