Malo o PHP-u
Odličan link za učenje PHP-a. Vrlo jasno objašnjeno, sa mnogo (funkcionalnih) primera.
Crtice o PHP-u
PHP is an acronym for “PHP: Hypertext Preprocessor”
PHP code are executed on the server, and the result is returned to the browser as plain HTML
PHP files have extension “.php”
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 runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
PHP is compatible with almost all servers used today (Apache, IIS, etc.)
PHP supports a wide range of databases
PHP is free. Download it from the official PHP resource: www.php.net
PHP is easy to learn and runs efficiently on the server side
A PHP script starts with
The default file extension for PHP files is “.php”.
A PHP file normally contains HTML tags, and some PHP scripting code.
Comments are done with # or //
In PHP, all keywords (e.g. if, else, while, echo, etc.), classes, functions, and user-defined functions are NOT case-sensitive. However; all variable names are case-sensitive.
In PHP, a variable starts with the $ sign, followed by the name of the variable
A variable name must start with a letter or the underscore character
A variable name cannot start with a number
A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
PHP has three different variable scopes : local, global and static
A variable declared within a function has a LOCAL SCOPE and can only be accessed within that function
A variable declared outside a function has a GLOBAL SCOPE and can only be accessed outside a function
echo and print are more or less the same. They are both used to output data to the screen.
PHP supports the following data types : String, Integer, Float (floating point numbers – also called double), Boolean, Array, Object, NULL, Resource
PHP divides the operators in the following groups : Arithmetic, Assignment, Comparison, Increment/Decrement, Logical, String, and Array operators
The real power of PHP comes from its functions; it has more than 1000 built-in functions.