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['
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 '
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,
1. Set CookiesPHP uses the Setcookie function to set cookies. It is important to note that cookies are part of the HTTP protocol header and are used to pass information between browsers and servers, so you must call the cookie function before any
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[
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 recent need to use the function of sending mail, originally from the PHP with the Mail () function sent. PHP mail () This method is very simple, convenient, easy to use, but in addition to NetEase mailbox, QQ mailbox, Gmail mailbox and other
File directory:
Iplocation-----Qqwry----------QQWry.Dat-----ipCity.class.php
ipCity.class.php File Code:
Copy Code code as follows:
Class IpCity {
/*** According to the IP address to obtain the corresponding city* @param type
1. The following values are judged to be true with empty ():
Unassigned variables, undeclared variables, 0, "0", "", false, NULL, empty array array (), magic Method of Objects __get () value returned by
In versions below PHP5.0, objects that do
In this paper, we analyze how to calculate the date difference between days in PHP. Share to everyone for your reference, specific as follows:
? PHP
//Today and October 27, 2016 difference between the number of days
$Date _1=date ("y-m-d");
$
This paper analyzes the related problems of generating random numbers for encryption. PHP 5 does not provide a simple mechanism for generating robust random numbers in cryptography, but PHP 7 solves the problem by introducing several CSPRNG
Here I draw a diagram demonstrating the handshake part of a websocket connection between the client and the server, which can be done very easily in node, because the net module provided by node has encapsulated the socket socket, and the developer
Install service sideMemcache is the name of the project, and the hosting process on the server is called memcached (Linux daemon is typically followed by a D). Using brew under OS X allows you to quickly install Memcache:
$ sudo brew install
When the building WordPress found incredibly will report this kind of mistake, the online solution is the same copy paste, is about the setting of Eaccelerator, I am surprised I did not install this extension ah? However, the installation of APC
This function has always been used to obtain:
Copy Code code as follows:
function Microtime_float () {
List ($usec, $sec) = Explode ("", Microtime ());
Return ((float) $usec + (float) $sec);
}
See other people's source
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