PHP encapsulates a database mysql class
// Configure the database
Define ('Db _ host', '127. 0.0.1 '); // server address
Define ('Db _ user', 'root'); // USER name
Php obtains the day of the week or a certain date.
Effect: today is: Friday is: Sunday [PHP] code
Function getWeekName ($ data, $ format = 'week ')
{
$ Week = date ("D", $ data );
Switch ($ week)
{
Php5 object replication, clone, Shap replication, and deep replication
Origin of object replicationWhy does an object have the concept of "copying", which is closely related to the object value passing method in PHP5. let's take a look at
PHP download file code [customizable]
Use the get method to pass in the http: // domain/download. php? parameter? File = 'savepath on server' & name = 'File name you want'
// Input the file path and file name,
Filter dangerous html code in form submission using php
PHP filters the html code of the submitted form, which may be exploited to introduce external dangerous content. For example, some forms submitted by the user contain html content, but
Use of PHPZip
Class PHPZip
{
Function Zip ($ dir, $ zipfilename)
{
If (@ function_exists ('gzcompress '))
{
$ Curdir = getcwd ();
If (is_array ($ dir ))
{
$ Filelist = $ dir;
}
PHP code for sending emails using mandrill
Mandrill is a powerful SMTP provider. Developers tend to use a third-party SMTP provider for better delivery. In the following function, you need to put "Mandrill. php" in the same folder as a PHP
PHP can detect the code snippets of the language used by the user's browser.
Use the following PHP code snippet to check the language used by your browser
Function get_client_language ($ availableLanguages, $ default = 'en '
Obtain the PHP code of the country using the IP address
Function getLocationInfoByIp (){
$ Client = @ $ _ SERVER ['http _ CLIENT_IP '];
$ Forward = @ $ _ SERVER ['http _ X_FORWARDED_FOR '];
$ Remote =
Php regular expression to retrieve all links to content
This example describes how to obtain all links of the content using a php regular expression. Share it with you for your reference. The details are as follows: Here we provide two
Object-oriented php operation mssql class
/*
Untested
*/
Class database_mssql {
Var $ database = NULL;
Var $ sqls = NULL;
Var $ host = NULL;
Var $ username =
PHP uses DES for encryption and decryption
There is an extension in php that supports the DES encryption algorithm: extension = php_mcrypt.dll Opening the extension in the configuration file cannot be used in windows. You need to copy
Php encode64 encoding class
Encode64 can obtain the minimum data encoded by 26 uppercase/lowercase letters and numbers plus the "-_" symbol. this string can be freely transmitted over the network, there is no need to consider the confusion
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