07 Jul PHP First Program
After installing PHP successfully on Windows, we learned how to run our first PHP program. Now, we will see another example and learn some more concepts about a PHP program. Our PHP first program will also explain the concepts of programming in PHP, which will further help in working with the PHP program in the upcoming lessons.
PHP program consists of the following tags:
- <?php = start tag
- ?> = end tag
- ; = statements in PHP end with a semi-colon
PHP files’ default extension is .php and a PHP program consists of the following:
- PHP scripting code
- HTML tags
Here’s our first PHP program,
<h1>First PHP program</h1>
echo "Hi, ";
echo "Our first PHP program!";
As you can see above, the output, Hi, Our first PHP program! will print, since echo is a built-in function that prints text.