PHP most commonly used file operation is read and write, today is mainly about reading and writing functions, and do a page access count function, to record the amount of access to a page.
fopen (): There is no file creation function in PHP, and
With the popularity of mobile devices, the site will also usher in more and more mobile devices access. Used to adapt to the PC page, often unfriendly to mobile phone users, then sometimes, we need to determine whether the user to access the phone,
In PHP I want to get a timestamp there are many ways, the most common is to use the time function and the strtotime () function to convert the date into a timestamp, I would like to share the time stamp function strtotime usage.
gets the specified
1, cannot pass the variable between the page
Get,post,session the automatic global variable is turned off in the latest PHP version, so the submitted variable from the previous page is to be obtained using $_get[' foo '],$_post[' foo '],$_session['
1, support Mass
2, Chinese into pinyin send
If you need to mass multiple accounts in English comma (, (86159..,86159), message content does not support Chinese, when you enter Chinese, the system will automatically convert to pinyin (in order to
Summary Title I put this message board is the simplest, in fact, should be called the most humble, because the whole focus on the MVC pattern design and implementation, so the UI aspect is almost no modification.
This small program contains 6 files,
Don't say much, we look at the code directly
Gets the domain name or host address
echo $_server[' Http_host ']. ";
Get page address
echo $_server[' php_self ']. " ";
Gets the URL parameter
echo $_server["Query_string"]. " ";
Get user
When configuring PHP5 to use MySQL as a database, many people think that as long as the php.ini to add Extension=php_mysql.dll, the instructions can not understand why many articles are recommended to add EXTENSION=PHP_ Mysqli.dll of the
Many programmers think that in PHP, single and double quotes are the same, in fact, it depends on how to use, in some ways they are the same, but there are some aspects of them are very different, today's small series to tell you what the difference.
Ideas:
1) will be long Web site MD5 generated 32-bit signature string, divided into 4 paragraphs, 8 bytes per paragraph;
2 to the four-segment loop, take 8 bytes, consider him as 16-string and 0X3FFFFFFF (30-bit 1) and operation, that is, more than 3
The example in this article describes how PHP generates and obtains JSON files. Share to everyone for your reference, specific as follows:
First defines an array, then traverses the data table, puts the corresponding data into the array, and
Today, in coding, I found the new static (), and felt that the instantiation should not be new self ()? Query to know the difference between the two:
1 when there is a child-class integration, the performance of the two is not the same
2 PHP 5.2
Copy code code as follows:
class Timer {
Private $StartTime = 0;//program run start time
Private $StopTime = 0;//program run end time
Private $TimeSpent = 0;//program Elapsed time
Function start () {//program run start
The example in this article describes the RSA encryption decryption based on OpenSSL in PHP. Share to everyone for your reference, specific as follows:
"d:/phpserver/lighttpd/openssl.cnf",//"
Config ' => ' d:/phpstudy/lighttpd/openssl.cnf '
On a professional Web site, users often need the user's account number and password, that is, identity confirmation action. The early NCSA httpd server did not provide this user-confirmed feature, and webmaster only had to hand-create an
But it's not easy to be a master of PHP programming. Not as many people imagine, as long as you can quickly write a few simple code to solve a complex problem is the Master of PHP programming, the real PHP master will need to consider more other
Access the country/city/latitude and longitude of the visitor based on IPInstall GeoIP Extensions:
sudo apt-get install Libgeoip-dev
Note: The beta version is to specify the version number. If it is apt to install PHP,
Generate two-dimensional code online using the API of Google online generation of two-dimensional code.
The code is as follows:
Copy Code code as follows:
two dimensional code generation-www.jb51.net
$content =$_get[
This article describes how PHP reads the contents of a torrent seed file. Share to everyone for your reference, specific as follows:
stack, Array ($this->y, $this->z, $this-&G
T;m, $this->n, $this->stat));
List ($this->y, $this->z, $this-
Create a new ANSI PHP file, and then make a class:
Copy Code code as follows:
Header ("content-type:text/html; Charset=utf-8 ");
Class google_api_translator{
Public $opts = Array ("text" => "", "Language_pair" => "En|it");
Public $out
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