There are hundreds of files in a folder such as IDR_WEB_BKG_PNG, IDR_WEB_BKG_XML, IDR_WEB_BKG_ICO, and files. it is too troublesome to manually update the suffix one by one. the batch update code in PHP is as follows:
Copy codeThe code is as
After studying for a long time, I finally found that php_mssql.dll and php_pdo_mssql.dll in the latest php5.3.6 have all disappeared. There is only one php_pdo_odbc.dll.
So ~ The latest and best php method for connecting to mssql is as
Simple php writing to the database class code sharing, learning php friends can refer. I don't know how to write the original article into the essay.
All right, the first blog.
There are three types:
1. filter input (lightweight)
Class
Php simulates a socket connection and sends data multiple times. For more information, see.
Copy codeThe code is as follows:
// Post. php
Function Post ($ host, $ port)
{
// $ Host = "127.0.0.1 ";
// Establish a connection
$ Conn =
PHP verification code. For more information, see. The checkcode. php generates the verification code image and the variable $ _ SESSION [check_pic].
Copy codeThe code is as follows:
Session_start ();
For ($ I = 0; $ I $ Rand. = dechex (rand (1, 15
Today, I reviewed and learned how to implement variables in PHP. by browsing its source code, I found that all data types in PHP are stored through a union. The php language is a weak type language, which is managed by recording the type and value
Today, I encountered a problem of intercepting Chinese and English strings. in gbk, each word occupies two bytes in Chinese. if it is all Chinese, use the substr () function, however, if both Chinese and English are available, it will be troublesome.
To remove duplicate values from an array, you can use the foreach method or the array_unique method. the following code uses both methods.
Copy codeThe code is as follows:
$ ArrF = array ();
$ ArrS = array ();
$ IntTotal = 100;
$ IntRand = 10;
For (
PHP array deduplication has a built-in function array_unique (), but php's array_unique function is only applicable to one-dimensional arrays and not to multidimensional arrays. The following provides a two-dimensional array array_unique function.
I have also written many Image upload programs before, but none of them are short below. The simpler the program, the better, right? First, run the source code. you can copy it to your computer to run it ~
Copy codeThe code is as follows:
PHP writes the sample code of the Yang Hui triangle. For more information about php Algorithms, see.
Copy codeThe code is as follows:
// Yang Hui triangle
For ($ I = 6; $ I> = 0; $ I --)
{
For ($ j = $ I; $ j {
If ($ j {
Echo"
A";
} Else
As we all know, the native function substr of php does not support intercepting Chinese strings. The following code provides a variety of methods to intercept php Chinese strings. String truncation is a very common programming task, which is often
Php uses foreach to operate the array code. For more information, see. Foreach () has two usage methods:
Copy codeThe code is as follows:
Foreach (array_name as $ value)
{
Statement;
}
Here, array_name is the name of the array to be traversed. in
Php getting started Knowledge Point 7: basic application of PHP functions, which are very common. you can take a look.
Copy codeThe code is as follows:
/*
* Simple functions
*/
Function fontBold ($ con ){
Return"
$ Con";
}
$ Str = "simple function
Php getting started to learn how to read and write php files. you can use the following two functions to read files: fread, file_get_contents
Copy codeThe code is as follows:
// Open the file
Using fpw.fopen('tmp.html ', 'r ');
// You can use
Usually there are many sessions and few cookies are used. this is to solve Discuz! Cookie is not required for automatic synchronous login. As a result, the setcookie setting does not take effect and is not displayed on the browser. After checking,
Today, a customer's server is frequently written with a backdoor and deleted. the following code was added to the program. you can pay attention to the parameters of the base64_decode function. Today, a customer's server is frequently written:
Mm.
This section briefly introduces some basic programming points. compared with system security, php Security defense requires programmers to be more careful with the various parameters entered by users. PHP code security and XSS, SQL injection, and so
PHPRPC is a lightweight, secure, cross-Internet, cross-language, cross-platform, cross-environment, cross-domain, support for transmission of complex objects, support for parameter reference, and support content output redirection, hierarchical
The prev () function moves the pointer to the current element to the position of the previous element and returns the value of this element. If the internal pointer has exceeded the first element of the array, the function returns false.
Prev ()
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