PHP (a recursive acronym for PHP: Hypertext Preprocessor) is a widely used, open-source, general-purpose scripting language that is particularly suited for web development and can be embedded into HTML.
That sounds good, but what does it mean? Here is an example:
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
<?php
echo "Hi, I'm a PHP script!";
?>
</body>
</html>
Instead of using numerous commands to generate HTML, as seen in languages such as C or Perl, PHP pages contain HTML with embedded code that performs specific tasks. In this example, the code outputs "Hi, I'm a PHP script!" The PHP code is enclosed within special opening and closing tags, <?php and ?>, which allow you to switch into and out of PHP mode.
One major difference between PHP and client-side JavaScript is that PHP code runs on the server and generates HTML that is then sent to the client. The client receives the output produced by the script but cannot see the underlying PHP code. You can even configure your web server to process all HTML files using PHP, making it difficult for users to determine how your code works behind the scenes.
One of the best things about PHP is that it is extremely easy for beginners to learn while offering many advanced features for professional programmers. Do not be intimidated by the long list of PHP features. You can get started quickly and begin writing simple scripts within a few hours.
Although PHP development focuses on server-side scripting, the language can do much more. Continue reading to explore the "What Can PHP Do?" section, or go directly to the introductory tutorial if you are only interested in web programming.
.jpg)
