What is PHP:
PHP refers to PHP: Hypertext Preprocessor (Translator note: Php:hypertext preprocessor, recursive naming)
PHP is a server-side scripting language, similar to ASP
PHP scripts are executed on the server
PHP supports many databases
PHP is an open source software (open source Software,oss)
What is a PHP file:
PHP files can contain text, HTML tags, and scripts
PHP file returns pure HTML to the browser
The file suffix of the php file is ". php", ". PhP3", ". phtml"
PHP script block starts with <?php and ends with?>
Two basic instructions for entering text via PHP: Echo and print
All variables in PHP start with the $ symbol
Variable naming rules:
Variable names must begin with a letter or underscore "_"
Variable names can contain only alphanumeric characters and underscores
Variable names cannot contain spaces. If the variable name consists of multiple words, you should use an underscore to split it, or start with an uppercase letter.
The collocated operator.
Strlen () to calculate the length of a string
Strpos () to retrieve a string or a character within a string
To create a PHP function:
1, all functions use the keyword "function ()" to start
2. Named function-the name of the function should indicate its function. The function name begins with a letter or underscore.
3. Add "{"-the section after opening curly braces is the code of the function
4. Inserting function code
5. Add a "}"-the function ends by closing the curly braces.
$_get HTTP GET method
$_pos HTTP Post method