Sei sulla pagina 1di 3

Php

What is PHP?
PHP is an acronym for "PHP: Hypertext Preprocessor"
PHP is a widely-used, open source scripting language
PHP scripts are executed on the server

What can PHP do ?


PHP can generate dynamic page content
PHP can create, open, read, write, delete, and close files on the server
PHP can collect form data
PHP can send and receive cookies
PHP can add, delete, modify data in your database
PHP can be used to control user-access
PHP can encrypt data
PHP lexical structure
Computer languages, like human languages, have a lexical structure. A source code of
a PHP script consists of tokens. Tokens are atomic code elements. In PHP language,
we have comments, variables, literals, operators, delimiters, and keywords.
White space in PHP is used to separate tokens in PHP source file. It is used to improve the
readability of the source code.
public $isRunning;
White spaces are required in some places; for example between the access specifier and the
variable name. In other places, it is forbidden. It cannot be present in variable identifiers.
A statement is a collection of PHP code that does something. It can be as simple as a variable
assignment or as complicated as a loop with multiple exit points. Here is a small sample of PHP
statements, including function calls, assignment, and an if statement:
Basics of PHP
• A comment is something which is ignored and not read or executed by PHP engine or the
language as part of a program and is written to make the code more readable and
understandable. These are used to help other users and developers to describe the code and
what it is trying to do. It can also be used in documenting a set of code or part of a program
• PHP is insensitive of whitespace. This includes all types of spaces that are invisible on the screen
including tabs, spaces, and carriage return. Even one space is equal to any numbers of spaces or
carriage return. This means that PHP will ignore all the spaces or tabs in a single row or carriage
return in multiple rows. Unless a semi-colon is encountered, PHP treats multiple lines as a single
command.

• SGML or Short HTML Tags: These are the shortest option to initialize a PHP code. The script starts
with <? and ends with ?>. This will only work by setting the short_open_tag setting in php.ini file
to ‘on’.

Potrebbero piacerti anche