1. Db. class. php
// Connect to the databaseClass Db {Static public function getDB (){Try {$ Pdo = new PDO (DB_DSN, DB_USER, DB_PWD );$ Pdo-> setAttribute (PDO: ATTR_PERSISTENT, true); // set the database connection to persistent connection.$ Pdo->
The following is a summary of several character functions in PHP: 1) ucfirstChange the first letter to uppercase, for example$ String = "this is my web development blog "; Echo ucfirst ($ string ); // Output: This is my web development blog 2)
Functions used: ignore_user_abort (), set_time_limit (0), sleep ($ interval) This Code only needs to close the browser once it runs. Ignore_user_abort (); // close the browser and run the PHP script. Set_time_limit (0); // use set_time_limit (0) to
After completing the deployment in the first phase of php5.3.10, I made a summary and wrote the php deployment into shell script automatically, which will facilitate the subsequent expansion and practice the shell script I learned
JQuery is an excellent Javascript framework that provides excellent packaging of js and many convenient functions. JQuery's ajax packaging is also excellent. JQuery can transmit data using the json File Transfer Protocol (similar to xml, and has a
/*** Verification Code* 2011/8/21* Kcj**/Include "isLogin. php ";// Generate a 4-digit Verification Code randomly$ Num = '';For ($ I = 0; $ I $ Num. = dechex (rand (); // The dechex function is a decimal transfer binary.}Session_start (); // enable
If we only use to download or js window. location = 'file path/upload ','. conf ','. bin' file. Of course, the document.execcommand('saveas', 'mycodes.txt ') (the second parameter is the file name to be saved) of JS can also be downloaded, but its
Remember. php remember the user name and password User name: "Name =" name "> password: "> remember the username and password Check_remember.php$ Name = $ _ POST ['name'];$ Password = $ _ POST ['Password'];$ Remember = $ _ POST
PHP uses the GD library for screenshot capturePHP5.2.2 and later versions of the GD library implement two screenshot functions: imagegrabscreen and imagegrabwindowIt is used to intercept the entire screen and intercept a window (same as ALT +
During PHP development, if you want to introduce a class from the outside, the include and require methods are usually used to include the file defining this class. This is not a big problem during small-scale development. However, in large
The main purpose of the Smarty template is to separate the logical layer and the presentation layer. Therefore, the template should not contain the logical part, and the logical layer should not contain HTML. This "very" approach to inserting
PrefaceReflecting on some of the recently written things, I feel a little bit
For coder that has learned java or C ++,
The syntax is meaningless, such as OOP and exceptions.
Instead of simply looking at the instance code,
If you don't understand it,
Description
In PHP, you can define session_set_save_handler to store Server session data on different media, such as files, apc or memcache caches, or databases. You can calculate the number of online users, or kick the login status of specific
Chunk () function[Function]This function splits an array into multiple arrays,The number of units in each array is determined by the size.The number of units in the last array may be smaller.The obtained array is a unit in a multi-dimensional array,
Paging ideas:You only need to get two variables to get half done:1. Number of records to be displayed per page $ pageSize2. Total data volume in the table $ rowCountWith the above two variables, we can get a total of several pages. $ pageCountThen,
What is builder mode?The builder mode is mainly used to eliminate complicated creation processes of other objects.Design scenarioThere is a user's UserInfo class. To create this class, you must create the user's name, age, money, and other
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