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,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<!DOCTYPE html> <html> <body> <h1>First PHP program</h1> <?php echo "Hi, "; echo "Our first PHP program!"; ?> </body> </html> |
As you can see above, the output, Hi, Our first PHP program! will print, since echo is a built-in function that prints text.
No Comments