PHP documentation for beginners, write your first php code, build your first application with php.
- PHP is a server side scripting language which stands for Hypertext Pre-processor and is used to develop static or dynamic websites or Web applications. π¨βπ» π©βπ»
- A scripting language is a language that interprets scripts at runtime π¨βπ«
- PHP is open source and free, large community document and most web hosting servers support PHP by default π€
PHP need web server, database and php parser,don't worry there are some excellent all-in-one windows, linux, and MacOs distributions that contain Apache, PHP, MySQL and other applications in a single installation file, e.g. XAMPP pick your own here and follow the installation instruction XAMPP SITE
PHP general syntax is :
<?php ... ?>And short-open tags look like :
<? ... ?>PHP variable are denotes fixes with a $ sign , php code always end with ; ex :
<?php
$name= 'Susane';
?>PHP has a total of eight data types:
| DataTypes | Meanings | Ex |
|---|---|---|
| Integers | Numbers without a decimal point | $number = 123; |
| Float | are floating-point numbers | $float = 12.3; |
| Boolean | Have two possible values true or false |
$bool = false; |
| NULL | Special type has one value NULL |
$null = null; |
| String | sequences of characters | $strValues = 'Potato'; |
| Array | indexed collections values | $arr = array(0,1,2); |
| Objects | instances of classes | $herbie = new Person(); |
| Resources | It is the storing of a reference to functions and resources external to PHP | database call |