PHP Basics-here, PHP is a scripting language embedded in HTML code, which is explained by the server, it can be used to manage dynamic content, support databases, process session tracking, and even build the entire e-commerce site.
PHP supports many popular and non-popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Dbase, Informix, Informix, Interbase, Access,
Microsoft SQL Server
PHP is almost omnipotent. specifically for Web development, PHP can complete any action that a server program can do, such as collecting form data, generating dynamic webpages, sending/receiving Cookies, etc.
Although PHP was originally designed for the Web, it can also be used as a command line language
PHP can help website developers provide localized services for website visitors. When a remote user clicks to enter the website, the website automatically provides
Page. If the requested language file exists, the text displayed by the user is the mother tongue. if the language file does not exist, the text is the default English or other language specified by Web developers.
PHP can be combined with Apache and compiled into an Apache binary file as a module. Because Apache can run on Windows, Linux, Solaries, and other operating system platforms, other Web languages cannot match PHP alone. In addition, the Web server built using Apache has the tracking function, so its security can be kept at the highest priority. From this perspective, ASP. NET or ASP default operating platform IIS is incomparable with PHP. Finally, PHP has a smaller code path, which means it reduces the time required to analyze and execute the PHP page server code, so it runs more quickly.
23:27:12
When Embedding PHP source code into an HTML document, you must insert it into the body of the HTML document, that is, the body.
If you want to convert other data types to Boolean data types, you must add bool or Boolean
You can use the gettype () function to return the type of the data type,
If you want to convert other data forms to a Boolean data type, the following values are considered as Boolean values FALSE.
△Boolean value FALSE itself
△Integer 0; others are TRUE, including negative
Delta floating point number 0.0
Delta null string and string "0"
△Array without elements
△Objects without member variables
△Special data type NULL (including unset variables)
The valid range of the ¥ integer is determined by the operating system. In Windows,-2147483648 ~ 2147483647
1) an octal integer starts with 0, and 2) a hexadecimal integer starts with 0x, for example, 0x1E, 3) If the number to be displayed exceeds the valid range of the integer data type, PHP uses floating point numbers for representation.
Do not forcibly convert unknown decimal places into integer data types using int or integer for calculation, because the results cannot be predicted, such as echo (int) (0.1 + 0.7) * 10) the result is 7 instead of 8.
The valid range of the ¥ floating point number depends on the operating system. the floating point number uses e or E to represent the base-10 Index, and the valid decimal point can reach 14 digits.
¥ Round () function to round a floating point number, for example, echo round (3.6, 0) // 4, echo round (1.95583, 2) // 1.96, echo round (1241757, -3) // 1242000, starting from the right of the integer, rounding the third integer,
13:27:49
The ceil () function converts a floating point to an integer without any conditions. However, the value returned by the ceil () function is still of the floating point data type.
The ¥ floor () function removes floating-point numbers unconditionally, and the returned value is still of the floating-point data type.
Use single or double quotation marks to enclose the string content.
The string of ¥ PHP can only contain 256 characters, so it does not support Unicode
¥ Can contain variable names in braces and connect them to other strings, for example, $ str = "done"; echo "Well {$ str }! ","
"; // Well done!
Take a character in the string, for example, $ str = "Dictionary"; echo ". The 1st characters are:", $ str {0 },"
"; // D
When you add a string and a number, the result is a number. the string is converted to a number that can be converted at the beginning of the string.
Example:
$x = 2 + "12.5"."
";echo $x;//14.5$x = 1 + "mynumber-1.3e3"."
";echo $x;//1$x = 1 + "10.1books"."
";echo $x;//11.1
The ¥ord () function obtains the ASCII code of the character. chr () converts the ASCII code to the multiplied character.