Simple PHP code for Baidu online drive files

Baidu's online storage is fast and stable, and you deserve it. If you support direct connection in the future, you can directly use Baidu's online storage. The temporary solution is provided here, which cannot be used in the future. Set the

Set the index. php file to read-only in PHP

After setting the read-only attribute for the index. php file, the trojan will not have the permission to append an advertisement to the end of the file.Let's take a look at the specificCode, SET index. php read-only: Copy code The Code is as

PHP queries the number of records that meet the conditions in the database (two methods)

When you need to output the number of website user registrations, or determine whether duplicate records exist before inserting data, you need to obtain the number of MySQL query records that meet the conditions. Method 1: make statistics

An example of using a temporary table to query data in PHP

CopyCodeThe Code is as follows: $ sql3 = "create temporary table atmp_table (UID int (11), dnum int (20) not null )"; Mysql_query ($ sql3 ); $ Sql3 = "insert into atmp_table (UID, dnum) Select uid, count (soid) as dnum From 'cy _ score2' Where

PHP implementation code for deleting and copying folders and all files in their folders

CopyCode The Code is as follows: /* Copy the xcopy function usage: * Xcopy ("feiy", "feiy2", 1): copy the files in feiy to feiy2, including subdirectories. * Xcopy ("feiy", "feiy2", 0): copy the file under feiy to feiy2, excluding subdirectories. *

PHP array and String Conversion Implementation Method

Copy codeThe Code is as follows: $ array = explode (separator, $ string ); $ String = implode (glue, $ array ); The key to using and understanding these two functions is the relationship between the separator and glue. When an array is converted

Example code for php to implement a single-chain table

Copy codeThe Code is as follows: // Linked list NodeClass node {Public $ id; // node idPublic $ name; // node namePublic $ next; // next node Public function _ construct ($ id, $ name ){$ This-> id = $ id;$ This-> name = $ name;$ This-> next = null;

CI framework source code reading, system constant file constants. php configuration

Configure system Constants 1. Check and configure these preferences when the file system is working. When the file system is running, these default values will increase the security of the system. However, when the underlying layer of php or apache

Use php to determine the browser type and language function code

We often see some websites that display the browser type and language you are currently using. For example, the browser you are using is IE6 or traditional Chinese. Does it look so dazzling. In fact, this function is not difficult to implement. It

PHP code for generating random user names and passwords

Sometimes we need to use a random user name and password in the application, which can greatly improve the security of the application. To generate a random user name and password in PHP, you can use the mt_rand function or the rand function, the

Differences between flush (), ob_flush (), and ob_end_flush () in php

Differences among flush (), ob_flush (), and ob_end_flush: First, let's talk about the buffer, which is a memory address space of 4096 (1 kb) [in php. output_buffering configuration is found in the ini configuration file. php has the php

Summary of php design patterns

1. Singleton Mode The Singleton Mode means that only one instance of this class exists in the application at any time. Generally, we use the singleton mode to allow only one object to access the database, thus preventing multiple database

PHP uses the CURL method to POST data to the API code

In fact, it is also relatively simple, on the Code: Copy codeThe Code is as follows: $ Url = 'HTTP: // 127.0.0.1/test. php'; // The Link pointed to by POST$ Data = array ('Access _ token' => 'thekeyvalue'); $ Json_data = postData ($ url, $ data )

Using the preg_replace function in php to match images and add links

Description: preg_replace: searches and replaces regular expressions. If you only want to match strings, we recommend that you use str_replace () because of its high execution efficiency.Mixed preg_replace (mixed pattern, mixed replacement, mixed

Php converts a string into a class referenced by an HTML object.

Copy codeThe Code is as follows: class HtmlEncode { Static $ _ convertToHtmlEntitiesSrcEncoding = 'utf-8 '; /*** Convert a non-ASCII string to an HTML Object** @ Example HtmlEncode: encode ("I believe"); // output: I believe* @ Param string $ s

Php Stored Procedure Call instance code

Copy codeThe Code is as follows: // For example, the stored procedure to be called is gxtj (a, B) $ Db = new mysqli ("localhost", "ssss", "aaaaa", "bbbb "); Mysqli_query ($ db, "set names utf8 "); $ Result = $ db-> query ("call gxtj ($ year, $ jd)");

PHP app JSON skills

Processing of js returned data by php json_decodeAfter php json_decode, the data returned to the front-end is: encode_str = "{" green ": 10," size ": 5," strock ": 12}Then js uses eval ("obj =" + encode_str + ";");Json data can be instantiated as an

PHP array transfer is a value transfer instead of a reference transfer concept to correct

When calling a function, you assign the PHP array as a real parameter to the form parameter. Modifying the parameter in the function does not affect the array. This process is passed as a value. The array variable is not a reference to the array

Php function code used to delete all files in folders and their folders

Copy codeThe Code is as follows: Function deldir ($ dir ){ // Delete the files in the directory first: $ Dh = opendir ($ dir ); While ($ file = readdir ($ dh )){ If ($ file! = "." & $ File! = ".."){ $ Fullpath = $ dir. "/". $ file; If (! Is_dir ($

Php regularly deletes files in folders (Clears cached files)

Is there any way to automatically clear temporary folders? The following code is a php code that cleans up files in a folder at regular intervals.Ps: this code will continue to be executed without restarting the website, so it is only used for

Total Pages: 12780 1 .... 10341 10342 10343 10344 10345 .... 12780 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.