Welcome to PHP: The Language Behind WordPress
PHP was created by Rasmus Lerdorf in 1994, originally as a small set of tools for tracking visits to his personal homepage (the name literally started as “Personal Home Page”). Today it powers a huge share of the entire web — including WordPress, which alone runs on roughly 40% of all websites, and by extension, the very site you are reading this course on right now.
PHP is a server-side scripting language, which means it runs on the web server, before the page ever reaches a visitor’s browser. A visitor only ever sees the HTML PHP produces; they never see the PHP source code itself, no matter how much they inspect the page. This is fundamentally different from JavaScript, which (mostly) runs directly in the visitor’s browser.
Where PHP runs
Every time a browser requests a .php file from a server, the server runs that PHP code, and only sends the resulting HTML output back to the browser. This request-response cycle happens fresh on every single page load, which is why WordPress can show completely different content to different visitors from the exact same underlying files.
Your first script
<?phpnecho "Hello, Tutoline!";n?>
Save this as hello.php. If you have PHP installed locally, run it with PHP’s built-in development server: php -S localhost:8000, then visit localhost:8000/hello.php in a browser. Check whether PHP is already installed with:
php --version
If it is not installed, macOS users can run brew install php, and Windows/Linux users can find installers and instructions at php.net.
Mixing PHP with HTML
<!DOCTYPE html>n<html>n<body>n <h1><?php echo "Welcome to Tutoline"; ?></h1>n <p>Today is <?php echo date("Y-m-d"); ?></p>n</body>n</html>
This ability to freely mix PHP logic directly into HTML markup is exactly how WordPress themes work — every template file in the theme you are reading this course through right now follows this same pattern of PHP blocks embedded inside HTML.
What you’ll build across this course
By the end of this course you’ll be comfortable with variables, control flow, functions, arrays, handling form submissions safely, object-oriented PHP, connecting to a database, and the namespaces, Composer, and API-building skills used in real, professional PHP projects.
Tip: every PHP block starts with
<?phpand ends with?>— everything in between is executed on the server, everything outside it is sent to the browser as-is.