PHP is an explanatory scripting language.
You can write HTML, CSS, JavaScript, and PHP in a php file to form a page for the browser to interpret the rendering. You can also use PHP as a service-side language for logical processing, and to connect to the database.
1. Using PHP
<?php
#这里是php代码
echo "Hello World";
?>
2.php function, class, keyword case insensitive; all variables are case-sensitive.
3. The variable starts with $, and the name begins with a letter or an underscore. No declaration is required and is created when the first assignment is made. If the type.
4. Scope
Local: in-function declaration
Global: Out-of-function declaration. $GLOBALS [V_name] stores all global variables in an array
Static: Not recycled at the end of a function call
5. Output
Echo: Output more than one string, no return value
Print: Outputs a string that always returns 1
6. Data type
String: Single quotation mark
Integer: 0x 16-Binary 8-binary
Floating point number
Logic
Array
Object
Null
7. String functions
strlen () string length
Strpos () retrieving characters or text
8. Constants
Define ("greeting", "Hello"); Once assigned, can no longer be changed.
9. Functions
Functions Func1 () {} function name is not case sensitive
function Func2 ($min =1) {...} set default value for parameter
10. Arrays
Indexed array
Associative arrays
Multidimensional arrays
11. Sorting
Sort () Rsort () a sort () Ksort () Arsort () Krsort ()
12. Super Global variables
$GLOBALS $_server $_request $_post $_get $_files $_env $_cookie $_session
13. Database
Mysql_connect functions such as php5.5 are no longer supported
Use the MYSQLI library function instead
Learn and remember--php Quick Start basics