From cedb5befd9f51f074bbacbf340c51dada9240aa5 Mon Sep 17 00:00:00 2001 From: NirvashPrime <37520562+NirvashPrime@users.noreply.github.com> Date: Tue, 16 Oct 2018 00:55:08 -0400 Subject: [PATCH] Updated syntax, corrected and added information. (#19433) Updated syntax to adhere to PSR, corrected outdated information, and added additional information regarding tags and indentation. --- .../php/php-syntax-and-comments/index.md | 79 ++++++++++++------- 1 file changed, 51 insertions(+), 28 deletions(-) diff --git a/client/src/pages/guide/english/php/php-syntax-and-comments/index.md b/client/src/pages/guide/english/php/php-syntax-and-comments/index.md index 445ed4c34d..7aaaff5de8 100644 --- a/client/src/pages/guide/english/php/php-syntax-and-comments/index.md +++ b/client/src/pages/guide/english/php/php-syntax-and-comments/index.md @@ -2,42 +2,65 @@ title: PHP Syntax and Comments --- -### PHP Syntax +## PHP Syntax -The structure of a PHP syntax somewhat looks like: +The structure of a PHP document may look something like: -```shell - ``` -This PHP script can be placed anywhere in the document. -A PHP file generally have HTML tags, and some scripting code . -The default file extension for PHP files is `.php`. - - ### How to make comments in PHP? - -A comment in PHP code is a line that is not read/executed as part of the program. Its only purpose is to be read by someone who is looking at the code. + ``` -### More information +**NOTE:** Shorthand syntax is also available, but should be avoided to reduce unwanted behavior. -For more resources you can visit: https://www.w3schools.com/php/php_syntax.asp +A PHP file may have HTML tags and / or JavaScript. + +The default file extension for PHP files is `.php`. + +## Indentation + +While this is mostly personal preference, it is most common to see the lines within the tags at the same level, like so: + +``` +