Workshop 1 - Hello World in PHP
The first PHP example will print "Hello World" in the browser window.
The PHP statement:
print("Hello World");
displays the message "Hello World" in the browser window. Here PHP statement is embedded into HTML documents and PHP statement appears between symbols.
The PHP print function displays the value or string within parentheses in the browser window.
Several important things to note about PHP scripts:
- PHP is case sensitive, print is different from PRINT
- PHP statements appear between
- PHP statements end with a semi-colon
- You can include comments in your PHP code by beginning the line or lines with // characters
- Your PHP files should have a .php extension rather than a .html extension. If scripts have a .html extension the server will not know that they are PHP files and will not parse and execute the PHP commands.
PHP is server-side scripting language. The PHP commands, which are embedded in the web page's HTML, are executed on the web server to generate dynamic HTML pages. This is workshop is very helpful to understand PHP. Good Work Kunal!
ReplyDelete