Check whether the php file has bom header code
// This file is used to quickly test whether the UTF-8 encoded file is added with BOM and can be automatically removed.
// By Bob Shen
$ Basedir = "."; /
Summary of php connection to mssql
$ Conn = mssql_connect ("instance name or server IP address", "username", "password ");
// Test the connection
If ($ conn)
{
Echo "connection successful ";
}
Conversion of textarea line breaks in php forms
It takes a long time to debug the problem of converting line breaks in textarea into br and saving it to the database. 1. you must know that the linefeed in textarea is \ n (I found that the
Php method for obtaining a date based on the year and week
Function getWeekDate ($ year, $ weeknum ){
$ Firstdayofyear = mktime (0, 0, 1, 1, $ year );
$ Firstweekday = date ('N', $ firstdayofyear );
$
Implementation of thinkphp background detection of user logon timeout
Class CommAction extends Action {
Public function _ construct (){
Parent: :__ construct ();
$ This-> checkAdminSession ();
}
Php-redis Document 4
This article is the fourth part of the php-redis Chinese document. if you need it, you can refer to it.This article is the fourth part of the php-redis Chinese document. if you need it, you can refer to it.GetRange
Php code encrypted with 3des (compatible with. net)
Class Crypt3Des
{
Private $ key = "";
Private $ iv = "";
/**
* Construct and pass two keys and IV that have been base64_encode
*
*
Calculate the age based on the date of birth (considering the leap year)
It mainly takes into account the leap year situation. if someone is born in 2.29, then if it is not a leap year, then 2.28 will be counted as the last year.
Php class for MySQL database operations
Php class for mysql database operations
//// // Database connection class ////////////////// //
Class connect {
Private $ host; // host name
Private $ name; // User
Stronger and PHP frameworks (self-developed application frameworks)
The first version of the PHP Framework. people who want to use this framework can provide valuable comments. And related bugs. I will continue to improve it in future
Sina PHP framework pure version 1.1 (with beautiful waterfall stream template)
Sina PHP framework pure version 1.1 (with beautiful waterfall stream template)Demo addressThe template calls56 ..1. includes non-ads on-site players;
Check whether the database has the same value.
$ Result = $ this-> result_row ($ query );Here, the $ this-> result_row () method is self-written,Too lazy to write the method for executing the QUERY and check result quantity,Do not know how
Php obtains 72-hour weather forecasts for cities [www.weather.com.cn]
Php obtains 72-hour weather forecasts for citiesDownload the weather forecast content data.txt from various cities: http://3.ibtf.sinaapp.com/data.txt?#]Demo address:
Php code for converting currency numbers into Chinese capital
Php code for converting currency numbers to uppercase Chinese characters:
$ Num = round ($ num, 2); $ num = $ num * 100; if (strlen ($ num)> 10) {return "oh, sorry, the number is too
A comprehensive truncation function (mostly used for content analysis)
/*
The collection truncation function is mainly used to analyze the collected content.
Getcon-remove html characters and spaces
A function used to create image thumbnails.
/**
* Create an image thumbnail and return the true result.
*
* @ Param string $ cat Directory
* @ Param string $ oldname original image file
Only converts the lowercase value of an integer to an uppercase value.
/*
Only the lowercase value of an integer can be converted to an uppercase value.
*/
Class ChineseNumber
{
// Var
Use php to generate a local unique identifier LUID
/**
* Returns a unique string that is unique in the local system,
* The return value is a 32-character string in the format of
How to parse Baidu search result link? Url parameters
Query Baidu link? Ulr = real link form
/*
Getrealurl: get the URL address after 301 and 302 redirection by
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