Today wrote an AES encryption class for PHP. Applies to the extension of Yii. If you do not need to replace the Yii::app ()->params[' Encryptkey '] in the YII framework with your corresponding default key. Class Code:
params[' Encryptkey ']:
Typically, when a visitor accesses a Web site, the page records the user's cookie information and the user is not on the line when the cookie expires. In this article we use PHP to record the guest IP, and record the cookie and expiration time on
In PHP, most variable types, such as strings, integers, floating-point, arrays, and so on, are value types, and classes and objects are reference types, which you need to be aware of when you use them.
See the user in the discussion of PHP & symbol,
This article mainly describes the PHP file upload with the relevant configuration of knowledge points. PHP File Upload function Configuration mainly involves the php.ini configuration file upload_tmp_dir,upload_max_filesize,post_max_size and other
Share to everyone php to judge upload file types of methods, we learn together.
/** * Read the first few bytes of the file to determine the file type * @return String/function Checktitle ($filename) {$file =fopen ($fi
Lename, "RB"); $bin
EOF is a very important concept, and almost every major programming language provides the corresponding built-in function to verify that the parser has reached the file EOF. In PHP, this function is feof (). The feof () function is used to determine
You can use the mb_detect_encoding () function in PHP to determine what the string is encoded in.
When using the Mb_detect_encoding function in PHP for code recognition, many people have encountered problems identifying coding errors, such as GB2312
The integer can be 10, 8, and 16.
When used in octal, the number needs to start at 0 (0);
When represented in hexadecimal, the number needs to begin with a 0x (0 x) or 0X (0 capital X);
Integer overflow: When an integer overflows, it is
Overview
Want to do a micro-letter public platform, read the micro-letter official URL access to the sample code, found that there is a problem seems to have been half known, is in the class inside the direct use of $_get. After a careful look at
With the Register_shutdown_function method, let's set up a second function that can be invoked when execution is closed.
That is, our function is invoked when our script executes or dies unexpectedly, causing PHP execution to close.
"Use Scene"
①
1. If you can use file_get_contents instead of file, fopen, feof, Fgets and other series of methods, as far as possible with file_get_contents, because his efficiency is much higher! But pay attention to file_get_ Contents PHP version problem when
The Core function code is as follows:
/** * Detect Access IP is the specified allowed IP * Enter description here ... */function check_ip () {$ALLOWED _ip=array (' 192.168.2.* ', ' 127.0.
0.1 ', ' 192.168.2.49 ');
$IP =getip ();
$check
Detailed reference:
Https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_ Websitestandard_htmlvariables
Defining Constants Paypalurl
Const PAYPAL_URL = ' https://www.sandbox.paypal.com/';
Record the data
Perhaps Fsockopen, Pfsockopen function does exist security risks, but we have no research, this is the IDC business, no matter what the reason, anyway, they are to disable the two functions, then how to solve it, the following is a small arrangement
There are a number of functions that can be used to traverse an array in PHP, such as the For statement, list, each, and foreach, which is also a few of the main functions that traverse an array in PHP, and I'll introduce you to the following four
So, in order to prevent such information from appearing, when I use foreach, I will force type conversion of the parameters, the situation is as follows:
foreach ((array) $arr as $key => $value);
This has been a peaceful thing, just a few days ago,
For TCP/IP, UDP, socket programming These words you are not very strange, right? With the development of network technology, these words are filled with our ears. Then I would like to ask:
1. What is TCP/IP, UDP?Where is the 2.Socket?What's
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