PHP + MYSQL page feed
In this program, the new class FENYE inherits the class DBSQL. Therefore, in the new class destructor, the parent class destructor is called to connect to the database, the config file contains the global variable
Simple MySQL search functions
A quick and simple way to search a MySQL database.Example:MysqlSearch ('items ', 'title tags', isset ($GET ['Q'])? $GET ['Q']: '', Array ('columns '=>' * ', 'method' =>' OR ', 'extraSQL '=>' AND active = "true"
Obtain all links by reading the source files of a website.
Read the source files of a website and analyze the source code using regular expressions to obtain all links.
/********** Qiushuiwuhen (2002-5-20 )***********/
PHP Chinese string truncation function
/***** First, the CSDN Forum PHP Banzhu xuzuning (nagging) boss, supports three types of encoding: gb2312, gbk, and big.
The following code is used :***/
$
Method 5: traverse all files and folders in a folder
Traverse all files and folders in a folder
Function list_dir ($ dirpath ){
If ($ dirpath [strlen ($ dirpath)-1]! = "\") {$ Dirpath. = "\\";}
Static $ result_array =
Delete files and corresponding folders
Delete directories and functions of the files contained
// Note $ dir file name eg: admin/runtime
// Delete the directory and the functions that contain the file
Function
Delete a file based on the file records in the database
Check whether the fields in the database correspond to the files in the folder. if there is no corresponding field, delete the file, which greatly reduces the usage of system resources.
Determine the access IP address
Determine the access IP address
Function getIP (){
If (! Empty ($ _ SERVER ["HTTP_CLIENT_IP"]) {
$ Cip = $ _ SERVER ["HTTP_CLIENT_IP"];
} Else if (! Empty ($ _ SERVER
A function that converts Chinese characters into pinyin.
A function that converts Chinese characters into pinyin.
$ D = array (
Array (& quot; a & quot;,-20319 ),
Array ("ai",-20317 ),
Array ("an",-20304 ),
Phpcurl Learning Summary
Note: curl can quickly capture webpages, simulate POST and GET requests. of course, it is not only encapsulation of HTTP protocol, but also supports FTP, proxy, HTTPS, LDAP and other applications. Curl is not
Method 3: traverse all files and folders in a folder
Traverse all files and folders in a folder
Function list_dir ($ dirpath ){
If ($ dirpath [strlen ($ dirpath)]-1! = '/'){
$ Dirpath. = "/";
}
Static $
Php code for generating thumbnails (good compatibility)
PHP generates a lot of thumbnail code, but it is completely compatible with gd1.6 and gd2.x, and can ensure that there is almost no clear code for thumbnail reduction. the following
Differences between empty () and isset () functions
This article describes the differences between empty and isset functions in php. For more information, see. When using php to write page programs, I often use the variable processing
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