first, the entrance
The entry file can be a single file can also be multiple files, I now use the basic files, but the contents of the entry file is basically the same, for later changes in other ways of entry to do the basis,
Copy Code code
Copy Code code as follows:
? Php
Require_once ("mssql.class.php");
1. Create a class and connect to a database
$DB = new MSSQL ("Dns=aaa;uid=sa;pwd=sa;dbname=test");
2. Connecting to the database
$conn = $db->config ("Dns=aaa;uid=sa;pwd=sa;
This example describes how PHP uses cookies to control access authorization. Share to everyone for your reference. Specifically as follows:
Copy Code code as follows:
if (isset ($_post[' name ')) | | Isset ($_post[' pass ')) {
If there
The examples in this article describe the way PHP uses cookies to implement and user sessions. Share to everyone for your reference. The specific analysis is as follows:
PHP contains a number of functions that can be used to manage and record user
PHP computes an array with the same number of occurrences, you can use PHP with its own function array_count_values:Description
The array array_count_values (array $input) Array_count_values () returns an array that uses the value in the input
This example describes how PHP uses regular expressions to get a picture URL. Share to everyone for your reference.
The implementation methods are as follows:
Copy Code code as follows:
Header ("Content-type:text/html;charset=utf-8");
Code 1:
Copy Code code as follows:
function Quicksort ($STR) {
if (count ($str) $key = $str [0];//takes a value and is later used for comparison;
$left _arr=array ();
$right _arr=array ();
For ($i =1 $i if ($str [$i]$left
Points:
1. The adapter pattern is mainly used to "want to reuse some existing classes, but the interface is inconsistent with the requirements of the reuse environment", in the legacy code reuse, class library migration is very useful.
2. Adapter
1, the use of ++i (A=++i, i=2 as an example)
First add the I value by 1 (that is, i=i+1), and then assign the variable a (that is, a=i),
The final a value is equal to 3, and the I value equals 3.
So a=++i is equivalent to i=i+1, a=i
2, the
Many do not say, directly on the code:
Copy Code code as follows:
Ignore_user_abort (TRUE); Set whether to break script execution when client disconnects
Set_time_limit (0);
$file = '/tmp/ignore_user.txt ';
if (!file_exists ($file)) {
One, array processing functions:
Drunk feeling: Array processing function is very common in PHP development, learning good array processing function is very important. The array processing function involves in the actual application: the creation of
See a problem on the Internet:
The result of Array ("a") +array ("B") is ___
A.array ("A", "B")B.array ("B", "a")C.array ("B")D.array ("a")
Answer: D
PHP two arrays added, why the result is still the same?
Because they are equivalent to array ("
This example describes the creation and deletion of PHP folders. Share to everyone for your reference. Specifically as follows:
1. Create a folder
Copy Code code as follows:
Creating a Folder
$file _path = "d:/fold/";
if
This article illustrates the way PHP matches a div with class in HTML and selects its contents. Share to everyone for your reference. The specific analysis is as follows:
Read a paragraph of HTML code first:
Copy Code code as follows:
The example of this article analyzes PHP for JSON operations. Share to everyone for your reference. The specific analysis is as follows:
Since JSON can be used in a variety of programming languages, we can use it to make small data relays, such as
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service