Menu

  •    
  • Home
  • Digital Accessibility
  • Web Accessibility Testing
    • Testing Principles
    • Automated Testing
  • Accessible Learning Materials
  • Development Principles
  • Inclusion in the learning process
  • HTML
    • HTML Syntax
    • Text Tags
  • CSS
    • CSS Syntax
    • Text Formatting CSS
  • PHP
    • PHP Syntax
    • PHP Functions

Contacts

  • t.todorov@ts.uni-vt.bg
  • 5003 Veliko Tarnovo, Bulgaria, Teodosii Turnovski St. #2

PHP Syntax

Basic rules of PHP syntax

A PHP script can be placed anywhere in the document. A PHP script starts with <?php and ends with ?> :

The default file extension for PHP files is ".php".

A PHP file usually contains HTML tags and PHP script code.

Below we have an example of a basic PHP file with a PHP script that uses a built-in PHP function "echo" to output the text "Hello World!" on web page:

<!DOCTYPE html> <html> <body> <h1>My first PHP page</h1> &lt;?php echo "Hello World!"; ?> </body> </html>