CODIFICATION 


php128 apg

The  PHP  coding follows, as in all programming languages, some basic and fundamental rules.

To write code in  PHP  you need to use an editor, which, depending on your level of knowledge, you can use a simple text editor.

To run a written code, you will need to have an appropriate environment and a browser.

The environment will support the  PHP  language.

The browser will be, in charge of, executing the code then written.

The PHP code is always delimited by the two tags:




<?php 
// initial tag

. . . . . . . . . . .

-- 
The PHP code --

. . . . . . . . . . .

// final tag
?>



<?=
// is always available regardless 
// of the short_open_tag ini setting
// available since PHP 5.4.0

. . . . . . . . . . .

-- 
The PHP code --

. . . . . . . . . . .

// final tag
?>

 DELIMITERS 


The final tag is sometimes omitted by some programmers.

However, this behavior may present some undesirable risks.

In this tutorial we always use the two tags.



 COMMENTS 


Embedded comments are important resources for identifying parts of the code.

There are two types: SINGLE LINE and MULTIPLE LINES.

See the following example:



<?php


// This is a single-line comment

#  This is also a single-line comment

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

   Embedded comments are important resources
   for identifying parts of the code.

    comment . . . . . . . .
    
    . . . . . . . with . . . . . . . .
    
    . . . . . . . . . multiple . . . . . .
     
    . . . . . lines - (C language style).
    
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    
?>

 PHP PROGRAMMING LANGUAGE 


Like all programming languages PHP basically uses INSTRUCTIONS and COMMANDS to fulfill its purpose.



 INSTRUCTIONS 


Regulated by some type of verification, before being executed.



 COMMANDS 


Independent of any type of verification to be executed.