Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Monday, September 21, 2026

What Is WordPress?

// websites

What Is WordPress?

WordPress is software for creating and managing websites. It provides a content management system that allows pages, blog posts, images, navigation, themes and other website content to be managed through an administrative interface.

// referral disclosure This article contains a WordPress.com referral link. If you use the link and make a qualifying purchase, Freelance Coder may receive WordPress.com account credit. You may also be eligible for referral credit under WordPress.com's current referral terms.
// definition

WordPress is a content management system

WordPress is a content management system, commonly shortened to CMS.

A CMS provides tools for creating, organising, editing and publishing website content.

Instead of manually editing every page as a separate HTML file, WordPress can store content and generate web pages dynamically.

// create a website

Build a website with WordPress.com

WordPress.com combines WordPress with managed hosting, giving you a platform for creating, hosting and managing a website from one service.

Explore WordPress.com ↗
// cms

What does a CMS do?

A content management system separates much of the website's content from the underlying code.

Content ↓ WordPress ↓ Theme + templates ↓ HTML + CSS + JavaScript ↓ Browser

This allows website owners to manage content without manually rebuilding every page.

// content

WordPress can manage posts and pages

Posts

Commonly used for articles, news and other date-based content.

Pages

Commonly used for more permanent content such as About, Contact and Services pages.

// editor

WordPress uses a block-based editor

Modern WordPress content can be assembled from blocks.

Paragraph Heading Image Gallery Columns Buttons Lists HTML

Blocks can be combined to construct pages and posts without manually writing all of the underlying HTML.

// themes

Themes control website presentation

A WordPress theme determines much of a site's visual presentation and page structure.

WordPress content + Theme ↓ Website design

Themes can define typography, colours, layouts, templates, headers, footers and other design elements.

// plugins

Plugins can add functionality

Plugins extend WordPress with additional features.

SEO E-commerce Forms Security Analytics Backups Memberships Automation

This allows a relatively simple WordPress installation to be extended into a much more sophisticated website.

// wordpress software

WordPress is software, not one hosting company

This distinction is important.

WordPress itself is website software that can be installed and hosted by many different hosting providers.

WordPress software ↓ Hosting provider ↓ Website
// wordpress.com vs wordpress.org

WordPress.com and WordPress.org are related but different

WordPress.com WordPress.org
Hosted WordPress service Home of the WordPress software project
Hosting is included Software can be installed with a hosting provider
Infrastructure is managed for you Hosting arrangements depend on the provider you choose
// wordpress.com

What is WordPress.com?

WordPress.com is a hosted service built around WordPress.

It combines the website software with managed hosting, meaning WordPress.com handles much of the underlying hosting infrastructure.

WordPress + Hosting + Management ↓ WordPress.com
// managed hosting

WordPress.com provides managed hosting

With managed hosting, the hosting provider handles many infrastructure responsibilities.

Hosting Security Backups Caching Updates Infrastructure
// domains

WordPress can use a custom domain

A new WordPress.com site can use a WordPress.com subdomain.

mywebsite.wordpress.com

A site with an appropriate paid WordPress.com plan can instead use a custom domain such as:

mywebsite.com

A domain registered somewhere else can also be connected to WordPress.com on eligible plans.

// domain + hosting

The domain and WordPress website are separate components

Domain name ↓ DNS ↓ WordPress hosting ↓ WordPress website

The domain provides the web address.

The hosting infrastructure runs the website.

WordPress manages the website content and application.

// php

WordPress is built primarily with PHP

WordPress uses PHP extensively on the server side.

Browser request ↓ Web server ↓ PHP ↓ WordPress ↓ Database ↓ Generated response ↓ Browser

PHP code can retrieve content, apply templates and generate the page returned to a visitor.

// database

WordPress stores information in a database

Website information such as posts, pages, settings and user data is typically stored in a database.

WordPress │ ├── Posts ├── Pages ├── Users ├── Settings ├── Comments └── Metadata ↓ Database

WordPress traditionally uses MySQL-compatible database systems for this data.

// web technologies

WordPress still produces ordinary web technologies

Despite the CMS and server-side infrastructure, visitors ultimately interact with familiar web technologies.

HTML

Provides the structure of the rendered page.

CSS

Controls the visual presentation.

JavaScript

Provides interactive browser behaviour.

PHP

Performs substantial server-side WordPress logic.

// cms vs static site

WordPress avoids manually maintaining every HTML file

A simple static website might contain:

index.html about.html contact.html services.html

With WordPress, much of that content can instead be managed through the CMS and generated using reusable templates.

Database content + Theme templates ↓ Generated web pages
// blogging

WordPress is well known for blogging

WordPress began with a strong focus on publishing articles and continues to provide extensive blogging functionality.

Posts Categories Tags Authors Comments Archives
// beyond blogs

WordPress can build much more than blogs

Business Websites Portfolios Blogs Online Stores Membership Sites Documentation News Sites Landing Pages
// ecommerce

WordPress can support online stores

E-commerce functionality can be added to WordPress using systems such as WooCommerce.

WordPress + WooCommerce ↓ Products Orders Payments Customers Storefront
// users

WordPress supports different user roles

Multiple people can work on the same site with different permissions.

Administrator Editor Author Contributor Subscriber
// api

WordPress also has an API

WordPress provides a REST API that can allow other software to interact with WordPress data.

External application ↓ WordPress REST API ↓ WordPress ↓ Posts / Pages / Data

This makes WordPress useful not only as a traditional website CMS but also as a content source for other applications.

// headless wordpress

WordPress can even be used without a traditional theme

In a headless architecture, WordPress can manage the content while another application handles the visible front end.

WordPress CMS ↓ API ↓ JavaScript application ↓ Website
// why wordpress

Why do people use WordPress?

Content Management

Pages and posts can be managed through a CMS.

Themes

Website presentation can be changed and customised.

Plugins

Additional functionality can be added to the site.

Extensibility

Developers can build custom themes, plugins and integrations.

// wordpress.com

WordPress.com removes much of the hosting administration

Running WordPress yourself can involve managing hosting, software updates, backups, security and other infrastructure.

WordPress.com offers managed WordPress hosting, so many of these infrastructure tasks are handled by the platform.

// try wordpress

Interested in building with WordPress?

You can explore WordPress.com, create a website and compare the available options using the Freelance Coder referral link below.

Visit WordPress.com ↗
// referral

WordPress.com referral credit

Under WordPress.com's current Refer a Friend programme, a new customer who follows a valid referral link and purchases an eligible annual WordPress.com plan can receive US$25 in WordPress.com account credit.

The person who referred them can also receive US$25 in WordPress.com account credit.

Monthly plans are not currently eligible for these referral credits. Referral terms can change, so check WordPress.com's current terms before purchasing.

Open Freelance Coder Referral ↗
// official information

WordPress.com information

For current WordPress.com features, hosting information and referral conditions, consult WordPress.com's official documentation.

WordPress.com hosting information ↗

WordPress.com Refer a Friend terms ↗

// summary

Content becomes a website.

WordPress is a content management system used to create and manage websites. It combines content, themes, plugins, databases and web technologies to produce websites ranging from simple blogs to business sites, online stores and larger web applications. WordPress.com provides a managed hosting platform built around the WordPress software.

// referral disclosure Freelance Coder uses a WordPress.com referral link on this page. If you make a qualifying purchase through the link, Freelance Coder may receive WordPress.com account credit. Referral eligibility and benefits are determined by WordPress.com's current terms.

What Is an API?

// software communication

What Is an API?

An API is an interface that allows one piece of software to interact with another. It defines how requests can be made, what information can be supplied and what results can be returned.

// definition

API means Application Programming Interface

API stands for Application Programming Interface.

An API provides a defined way for software systems, applications or components to communicate.

Instead of one program needing to understand the internal code of another program, it can communicate through the interface the API exposes.

// simple idea

An API is a controlled interface

Application A ↓ API ↓ Application B

Application A does not necessarily need access to the internal workings of Application B.

It only needs to know how to use the API correctly.

// example

Imagine a weather application

A website wants to display the current temperature in London.

Instead of measuring the weather itself, it can request information from a weather service.

Website ↓ Weather API ↓ Weather service ↓ Temperature data ↓ Website

The website can then display the information returned by the API.

// request + response

Many APIs use requests and responses

A client sends a request.

The API processes the request and sends a response.

Client ↓ Request ↓ API ↓ Processing ↓ Response ↓ Client

This request-response model is extremely common in web APIs.

// web api

Web APIs communicate over networks

Many modern APIs are accessed using HTTP or HTTPS, the same fundamental protocols used by websites.

https://api.example.com/products

Software can send an HTTP request to this address and receive structured information in return.

// endpoint

What is an API endpoint?

An endpoint is a particular location exposed by an API for performing an operation or accessing a resource.

/products /products/42 /customers /orders

Different endpoints can provide access to different types of information or functionality.

// http methods

HTTP methods describe the intended operation

Method Common purpose
GET Retrieve information
POST Submit or create information
PUT Replace or update a resource
PATCH Partially update a resource
DELETE Remove a resource

The exact meaning depends on the API's design.

// get

GET can retrieve information

GET /products/42

The API might return:

{ "id": 42, "name": "Keyboard", "price": 39.99 }
// post

POST can send information

A client might create a new customer by sending:

POST /customers

with data such as:

{ "name": "Alice", "email": "alice@example.com" }

The server can validate the information, store it and return a response.

// json

APIs commonly use JSON

JSON is a convenient format for exchanging structured information between software systems.

{ "customer": { "id": 101, "name": "Alice", "active": true } }

A client can parse this data and use the individual values in its own application.

// data formats

APIs do not have to use JSON

Depending on the system, an API may exchange data using:

JSON XML HTML Plain Text Binary Data
// parameters

Requests can include parameters

Parameters allow the client to specify what it wants.

GET /weather?city=London

Here:

city=London

provides additional information to the API.

// headers

HTTP requests can contain headers

Headers carry metadata about a request or response.

Content-Type: application/json Authorization: Bearer TOKEN

Headers can specify things such as data format, authentication information and caching behaviour.

// authentication

Many APIs require authentication

An API may need to know which application or user is making a request.

Common approaches include:

API Keys Access Tokens OAuth Sessions Signed Requests

API credentials should be protected. Private keys and tokens should not normally be exposed publicly in website source code or public repositories.

// api key

What is an API key?

An API key is a value that can identify an application or account when making API requests.

API-Key: abc123...

The service can use the key to determine who is making the request and which permissions or usage limits apply.

// status codes

Web APIs often return HTTP status codes

Code General meaning
200 Request succeeded
201 Resource created
400 Problem with the request
401 Authentication required or invalid
403 Request understood but not permitted
404 Resource not found
429 Too many requests
500 Server-side error
// javascript

JavaScript can call web APIs

fetch("https://api.example.com/products") .then(response => response.json()) .then(data => { console.log(data); });

The browser sends the request, receives the response and converts the JSON into JavaScript data.

// server-side code

Server-side software can also use APIs

PHP, Python, JavaScript, Java, C# and many other languages can communicate with APIs.

Application ↓ API request ↓ External service ↓ API response ↓ Application

APIs allow systems written in completely different programming languages to work together.

// database

An API can sit between an application and a database

Website ↓ API ↓ Server application ↓ Database

The website does not need direct access to the database.

Instead, the API exposes specific operations while the server controls how the underlying data is accessed.

// controlled access

APIs can control what software is allowed to do

An application may be allowed to:

Read Products Create Orders Update Profiles Upload Files

while being prevented from directly accessing internal systems or performing unauthorised operations.

// rate limits

APIs can limit how frequently they are used

A service might allow:

1,000 requests per day

or:

100 requests per minute

These restrictions are called rate limits.

// rest

What is a REST API?

REST stands for Representational State Transfer.

It describes an architectural style for designing networked systems.

APIs described as RESTful commonly organise operations around resources and use HTTP methods such as GET, POST, PUT, PATCH and DELETE.

API and REST API are not synonyms. REST is one approach to API design. APIs can use many other architectures and protocols.

// other api styles

APIs can use different technologies

REST GraphQL SOAP RPC WebSockets

The best approach depends on the systems involved and what they need to communicate.

// important distinction

Not every API is a web API

The term API is broader than internet services.

Programming languages, operating systems, libraries and software frameworks can all expose APIs.

Browser API Operating system API Database API JavaScript API Web API Library API

In each case, the API defines how another piece of software can interact with the system.

// examples

What can APIs connect?

Payments

A website can communicate with a payment service.

Maps

An application can retrieve maps or location data.

AI

Software can send prompts or data to an AI service.

Email

Applications can send or manage messages through email services.

Accounting

Business systems can exchange invoices, transactions or customer information.

Automation

One service can trigger actions in another system.

// automation

APIs make automation possible

Suppose a customer submits an online order.

Order received ↓ Payment API ↓ Database ↓ Email API ↓ Accounting API ↓ Order completed

Multiple systems can communicate automatically without someone manually copying the information between them.

// contract

An API behaves like a software contract

The API documentation defines how another program is expected to interact with the system.

It might specify:

Endpoints Methods Parameters Authentication Data Formats Responses Errors Rate Limits

As long as both systems follow the agreed interface, their internal implementations can often change without requiring the other system to understand those details.

// advantages

Why are APIs so useful?

Integration

Different software systems can work together.

Automation

Information can move between systems automatically.

Abstraction

Applications can use functionality without knowing every internal implementation detail.

Reuse

The same service can support websites, mobile apps, internal tools and other software.

// mental model

The simplest way to think about an API

Your software ↓ "Please do this" ↓ API ↓ Other software ↓ Result ↓ Your software

The API defines the rules for that conversation.

// summary

Software talking to software.

An API is an Application Programming Interface: a defined way for software systems to interact. APIs can expose data and functionality through requests, responses, endpoints and documented rules, making them fundamental to integrations, automation, websites, applications and modern software systems.

What Is SQLite?

// databases

What Is SQLite?

SQLite is a lightweight relational database system that stores an entire database in a file. Unlike many database systems, it does not require a separate database server running in the background.

// definition

SQLite is an embedded relational database

SQLite is a relational database management system designed to be embedded directly inside applications.

A complete SQLite database is commonly stored in a single file on disk.

Applications interact with that file using SQL commands such as SELECT, INSERT, UPDATE and DELETE.

// simple idea

A database can be just one file

A SQLite database might look like this:

customers.db

Inside that file could be several tables:

customers orders products payments

The application can open the database file and query those tables directly.

// serverless

SQLite does not need a separate database server

Systems such as MySQL and PostgreSQL normally run as separate database server processes.

Applications connect to those servers over a local connection or network connection.

SQLite works differently.

Application ↓ SQLite library ↓ database.db

The application accesses the database through the SQLite library rather than contacting a separate database server.

// sql

SQLite uses SQL

SQL stands for Structured Query Language.

SQL is used to create, read, update and delete data stored in relational databases.

SELECT * FROM customers;

This query asks SQLite to return all rows from the customers table.

// tables

SQLite stores data in tables

A customer table might contain:

id name email
1 Alice alice@example.com
2 Ben ben@example.com
3 Carla carla@example.com

Each row represents a record, while each column represents a particular type of information.

// create table

Tables can be created with SQL

CREATE TABLE customers ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, email TEXT );

This creates a table containing three columns:

id name email
// insert

Data can be inserted

INSERT INTO customers ( name, email ) VALUES ( 'Alice', 'alice@example.com' );

This adds a new row to the customers table.

// select

Data can be retrieved

SELECT name, email FROM customers;

A condition can also be added:

SELECT * FROM customers WHERE id = 1;

This retrieves the customer whose ID is 1.

// update

Existing data can be changed

UPDATE customers SET email = 'alice.new@example.com' WHERE id = 1;

This changes the email address associated with the selected row.

// delete

Rows can be deleted

DELETE FROM customers WHERE id = 1;

The matching row is removed from the table.

// crud

These operations are often called CRUD

Create

Add new records to the database.

Read

Retrieve existing information.

Update

Change existing records.

Delete

Remove records from the database.

// relational

SQLite is a relational database

Relational databases can connect information stored across different tables.

For example:

customers id | name 1 | Alice orders id | customer_id | total 1001 | 1 | 49.99 1002 | 1 | 18.50

The customer_id value connects the orders to Alice's customer record.

// joins

SQL can combine related tables

SELECT customers.name, orders.total FROM customers JOIN orders ON customers.id = orders.customer_id;

The database can use the relationship between the tables to combine the relevant information.

// files

SQLite databases can use different file extensions

You may encounter files such as:

data.db database.sqlite app.sqlite3 customers.db

The extension does not fundamentally determine whether the file is a SQLite database. It is mainly a naming convention.

// storage classes

SQLite can store several kinds of values

Storage class Purpose
NULL No value
INTEGER Whole numbers
REAL Floating-point numbers
TEXT Text strings
BLOB Binary data
// embedded

SQLite is often embedded inside applications

Software can include SQLite as part of the application itself.

The user may never even realise that a SQLite database is being used.

Desktop Apps Mobile Apps Browsers Local Tools Development Testing
// portable

SQLite databases are highly portable

Because a database can be stored in a single file, it can be straightforward to copy, back up or move.

project/ │ ├── app.py ├── database.db └── settings.json

The database can sit directly alongside the application files.

// sqlite vs csv

SQLite is very different from CSV

CSV SQLite
Plain-text file Database file
Usually one table Can contain many tables
No SQL engine Supports SQL queries
Limited relationships Relational structure
Simple data exchange Application data storage
// sqlite vs mysql

SQLite and MySQL use different architectures

SQLite MySQL
Embedded database Database server
Database commonly stored in one file Server manages database storage
No separate server required Requires database server software
Excellent for local and embedded use Common for networked applications
// sqlite vs server database

SQLite is not designed for every database workload

SQLite is extremely useful when simplicity and local storage are important.

A dedicated database server such as PostgreSQL or MySQL may be more appropriate when an application requires many simultaneous writers, centralised access, extensive server administration or large multi-user workloads.

SQLite is not simply a smaller MySQL. Its architecture is deliberately different. It is designed to provide a database engine directly inside an application.

// transactions

SQLite supports transactions

A transaction allows several database operations to be treated as one logical unit.

BEGIN; UPDATE accounts SET balance = balance - 50 WHERE id = 1; UPDATE accounts SET balance = balance + 50 WHERE id = 2; COMMIT;

Transactions help protect data from being left in an incomplete state if an operation fails.

// reliability

SQLite supports ACID transactions

Atomicity

A transaction is completed as a unit or rolled back.

Consistency

Database rules can help preserve valid states.

Isolation

Transactions are managed to avoid unsafe interference.

Durability

Committed changes are designed to survive failures.

// indexes

Indexes can improve query performance

CREATE INDEX idx_customer_email ON customers(email);

An index can allow the database to find certain values more efficiently instead of examining every row.

// programming

Many programming languages can use SQLite

Python PHP JavaScript C C++ Java C# Swift
// example with python

SQLite can be used from application code

For example, Python includes support for SQLite:

import sqlite3 connection = sqlite3.connect("customers.db") cursor = connection.cursor() cursor.execute( "SELECT * FROM customers" ) rows = cursor.fetchall() connection.close()

The program opens the database file, executes a query and retrieves the results.

// uses

What is SQLite used for?

Mobile Apps Desktop Software Local Data Application Settings Prototypes Testing Small Websites Data Analysis Embedded Systems Offline Applications
// advantages

Why is SQLite useful?

Simple

No separate database server needs to be configured.

Portable

An entire database can commonly be stored in one file.

Lightweight

The database engine can be embedded directly inside an application.

Powerful

It still provides SQL, transactions, indexes, relationships and many database features.

// important distinction

A SQLite database is more than an ordinary data file

A CSV file stores rows of text.

A JSON file stores structured text.

A SQLite file contains a database managed by an actual database engine.

CSV → data file JSON → structured data file SQLite → database stored in a file

That distinction is important.

// summary

A database inside one file.

SQLite is an embedded relational database system that provides SQL, tables, relationships, transactions and indexes without requiring a separate database server. Its simplicity and portability make it useful for mobile apps, desktop software, local tools, prototypes and many other applications.

Friday, September 18, 2026

What Is PHP?

// server-side programming

What Is PHP?

PHP is a programming language widely used for server-side web development. It can generate web pages, process forms, communicate with databases, manage sessions and build dynamic websites and applications.

// definition

PHP is a server-side scripting language

PHP is a general-purpose programming language particularly suited to web development.

PHP code commonly runs on a web server rather than directly inside the user's browser.

The server executes the PHP code and sends the resulting output, often HTML, back to the browser.

// name

What does PHP stand for?

PHP is officially described using the recursive acronym:

PHP: Hypertext Preprocessor

The name reflects PHP's long association with generating and processing web content.

// example

What does PHP look like?

<?php echo "Hello, world!"; ?>

The echo statement sends text to the output.

In a web application, that output can become part of the HTML returned to the browser.

// server

PHP usually runs before the page reaches the browser

Browser requests page ↓ Web server receives request ↓ PHP code executes ↓ PHP generates output ↓ Server sends response ↓ Browser displays page

The browser usually receives the output generated by PHP rather than the original PHP source code.

// php + html

PHP can be embedded inside HTML

<h1>Welcome</h1> <p> Today is <?php echo date("d F Y"); ?> </p>

PHP executes on the server and inserts the generated value into the document before it is sent to the user.

// variables

PHP can store information in variables

<?php $name = "Alice"; $orders = 4; echo $name; echo $orders; ?>

PHP variable names normally begin with a $ symbol.

// data types

PHP supports different kinds of data

Type Example
String "Freelance Coder"
Integer 42
Float 19.99
Boolean true
Array ["HTML", "CSS", "PHP"]
Null null
Object new Customer()
// arrays

PHP arrays can store collections of data

<?php $skills = [ "HTML", "CSS", "JavaScript", "PHP" ]; echo $skills[0]; ?>

This outputs:

HTML
// associative arrays

PHP arrays can also use named keys

<?php $customer = [ "name" => "Alice", "orders" => 4, "active" => true ]; echo $customer["name"]; ?>

Associative arrays are useful for representing structured information using named keys and values.

// conditions

PHP can make decisions

<?php $loggedIn = true; if ($loggedIn) { echo "Welcome back."; } else { echo "Please sign in."; } ?>

Conditional statements allow different code to run depending on the state of the application.

// functions

PHP functions package reusable logic

<?php function greet($name) { return "Hello, " . $name; } echo greet("Alice"); ?>

The full stop operator joins strings together in PHP.

// loops

PHP can repeat tasks

<?php for ($i = 1; $i <= 5; $i++) { echo $i; } ?>

Loops are useful when the same operation must be repeated several times.

// foreach

foreach is useful for collections

<?php $skills = [ "HTML", "CSS", "PHP" ]; foreach ($skills as $skill) { echo $skill; } ?>

The loop processes each item in the array one at a time.

// forms

PHP can process form submissions

A website might contain a form:

<form method="post"> <input type="text" name="name" > <button type="submit"> Send </button> </form>

PHP can receive the submitted data:

<?php if ($_SERVER["REQUEST_METHOD"] === "POST") { $name = $_POST["name"] ?? ""; } ?>

User input should be validated and handled safely. Real applications should never assume that submitted information is automatically trustworthy.

// databases

PHP can communicate with databases

PHP is commonly used with relational databases such as MySQL and PostgreSQL.

An application might use a database to store:

Users Products Orders Blog Posts Settings Transactions
// database connection

PHP provides database interfaces

One common approach is PHP Data Objects, or PDO.

<?php $pdo = new PDO( "mysql:host=localhost;dbname=shop;charset=utf8mb4", $username, $password ); ?>

Applications can then execute database queries through the connection.

// sql safety

Prepared statements are important

<?php $stmt = $pdo->prepare( "SELECT * FROM users WHERE email = ?" ); $stmt->execute([$email]); $user = $stmt->fetch(); ?>

Prepared statements allow values to be supplied separately from the SQL structure and are an important defence against SQL injection.

// sessions

PHP can maintain session data

<?php session_start(); $_SESSION["user_id"] = 123; ?>

Sessions allow a server to associate information with a user across multiple requests.

They are commonly used for login systems and other stateful website features.

// cookies

PHP can also work with cookies

<?php setcookie( "theme", "light", time() + 3600 ); ?>

Cookies are stored by the browser and can later be sent back to the server with requests.

// json

PHP works with JSON

PHP can convert arrays and objects into JSON:

<?php $data = [ "name" => "Alice", "orders" => 4 ]; echo json_encode($data); ?>

It can also convert JSON into PHP data:

<?php $data = json_decode( $json, true ); ?>

This makes PHP useful for building and consuming APIs.

// APIs

PHP can power APIs

Instead of returning an HTML page, a PHP application can return structured data.

<?php header( "Content-Type: application/json" ); echo json_encode([ "status" => "success", "message" => "Data received" ]); ?>

Another application can then consume the JSON response.

// php vs javascript

PHP and JavaScript often work together

PHP

Commonly runs on the server and handles server-side application logic.

JavaScript

Commonly runs in the browser and handles interactive client-side behaviour.

PHP Output

Can generate HTML or JSON that is sent to the browser.

JavaScript Requests

Can send requests to PHP-powered APIs and process their responses.

// web application

A PHP web application might work like this

User ↓ Browser ↓ HTTP request ↓ Web server ↓ PHP application ↓ Database ↓ PHP generates response ↓ HTML or JSON ↓ Browser

PHP often acts as the server-side layer connecting users, application logic and stored data.

// wordpress

WordPress is built with PHP

PHP has played a major role in the development of content management systems.

WordPress uses PHP extensively for themes, plugins, templates, database interaction and server-side logic.

<?php the_title(); the_content(); ?>

WordPress-specific PHP functions can dynamically retrieve and display website content.

// .php files

PHP code is commonly stored in .php files

index.php contact.php login.php api.php functions.php

A web server configured for PHP can execute the PHP code when one of these files is requested.

// security

Server-side code must handle data carefully

PHP applications often process passwords, form inputs, database queries, cookies and uploaded files.

Secure applications therefore need appropriate validation, escaping, authentication and database practices.

Never trust input simply because it came from your own website. Server-side code should validate data and apply the correct security controls for how that data will be used.

// frameworks

PHP has a large software ecosystem

Developers can use frameworks and content management systems rather than building every component from scratch.

Laravel Symfony WordPress Composer PHPUnit
// uses

What is PHP used for?

Dynamic Websites WordPress APIs Databases Forms Authentication E-commerce Web Applications Server-Side Logic Automation
// summary

The server does the work.

PHP is a programming language widely used for server-side web development. It can generate HTML, process forms, manage sessions, communicate with databases, work with JSON and APIs, and power dynamic websites and applications such as WordPress.

What Is an IP Address?

// networking What Is an IP Address? An IP address is a numerical address used t...