PHP Introduction
PHP stands for Hypertext Preprocessor. It is a widely-used, open-source scripting language especially suited for web development, and it can be embedded directly into HTML. PHP code runs on the server, and the result โ plain HTML โ is sent to the browser.
PHP powers a huge portion of the web, including popular platforms like WordPress, Facebook (in its early years) and countless custom web applications. It works well with databases like MySQL, is free to use, and runs on many different platforms such as Windows, Linux and macOS.
What can PHP do?
PHP can generate dynamic page content, create, open, read, write, delete and close files on the server, collect form data, send and receive cookies, and interact with databases to add, delete and modify data.
Why use PHP?
PHP runs on many platforms and web servers, is free and open source, is easy to learn for beginners, and is supported by a huge community with extensive documentation.
<?php
echo "Hello, World!";
?>Hello, World!PHP code is placed between <?php and ?> tags, and echo outputs text to the page.
<?php
$name = "Amy";
echo "Hello, " . $name . "!";
?>Hello, Amy!This example combines a variable with text using the dot (.) concatenation operator.
Key points
- PHP stands for Hypertext Preprocessor.
- PHP code runs on the server, producing HTML sent to the browser.
- PHP is free, open source, and cross-platform.
- PHP works well with databases like MySQL.
