PHP Syntax

A PHP Code block starts with "<?php" and ends with "?>", can be placed anywhere in the HTML.

On servers with shorthand enabled setting, you can start a code block with <? and end with ?>. But for compatibility, we recommend that you should always use the standard form "<?php" rather than the shorthand form.

<?php echo "Hello World" ?>

 For PHP Code you should always ensure that it's ends with a semicolon  ";" if your not using single line code for example.

<?php
 echo "Hello World";
?>

  Comments in PHP For comment in PHP You can use double front slash  "//" OR you can use hash "#" for single line comment, and for commenting a block of code you can use "/*"  "*/", for example.

<?php #This is single line comment and willl not excute on server.
//This is also single line comment and willl not excute on server. /*
Commenting a block of code for 
future reference
*/
echo "Hello World";
?>
Submit an Idea
  Thank you for your valuable feedback.
Your E-mail (optional):
Select Option:
Description:
 
Feedback
Your Name / email address
Feedback as
Your feedback
close
Quickly sign in with:

Create a FATALWEB account here:

First name:

Last name:

E-mail address:

Join Fatalweb

Already have a fatalweb account? Log in here