Php AES encryption and decryption
Php code, php provides many good things and uses functions directly. However, php currently only knows the ZeroPadding mode, so other languages can only follow it:
$ PrivateKey = "123456781
A simple PHP class for a socket client
Php 5. You need to enable socket extension
// Socke operation class
Class Socket {
Private $ host; // host connected to the socket
Private $ port; // the port number of the
PHP sensitive word filtering code
$ F = file('words.txt ');
$ Words = array ();
Foreach ($ f as $ w ){
$ Words [] = preg_quote (trim ($ w ),'/');
}
$ Text = file_get_contents('text.txt ');
$
PHP a simple and quick sorting
Fast sorting by constantly locating the location of the benchmark number
/**
* Created by PhpStorm.
* User: saint
* Date: 15/8/5
* Time: AM
*/
Class Demo
{
PHP adds subtitle display to the video through ffmpeg
$ Dir = './'; // set to current folder
If ($ handle = opendir ($ dir )){
While (false! ==( $ File = readdir ($ handle ))){
If (is_file ($ dir. $ file )){
PHP prevents multiple IP addresses from accessing your website
This code snippet allows you to prohibit certain IP addresses from accessing your website.
If (! File_exists('blocked_ips.txt ')){
$ Deny_ips = array (
'2017
PHP obtains the real IP address of a user.
Function getRealIpAddr ()
{
If (! Emptyempty ($ _ SERVER ['http _ CLIENT_IP '])
{
$ Ip = $ _ SERVER ['http _ CLIENT_IP '];
}
Elseif (! Emptyempty ($ _
Nobackend is used in website architecture
Nobackend is used in website architectureThe current application development model places too much emphasis on backend construction. In fact, we have already done many years of work to simplify
PHP extracts the main color of any image
Function dominant_color ($ image)
{
$ I = imagecreatefromjpeg ($ image );
For ($ x = 0; $ x
For ($ y = 0; $ y
$ Rgb = imagecolorat ($ I, $ x,
PHP calculates the distance code between two points of latitude and longitude
The following is an analysis of the PHP distance code for calculating the latitude and longitude of 2 points.
Function
Php script for uploading files through ftp
The general principle is to traverse all non-exclusive files in the project and then obtainThe file modification time is later than the last modification time of the file.And then upload these
PHP formatting time, several minutes ago, several hours ago
// Formatting time, several minutes ago, several hours ago
Function format_date ($ time ){
$ T = time ()-$ time;
$ F = array (
'20140901' => '
Implemented php class that supports resumable download of files
The example in this article describes the php-enabled resumable object download class and its usage. it is a very practical technique. Share it with you for your reference. The
Returns the regular expression of a number in a string.
$ Patterns = "/\ d +/"; // The first
// $ Patterns = "/\ d/"; // second
$ Strs = "left: 0px; top: 202px; width: 90px; height: 30px ";
Preg_match_all ($
Use PHP to implement the short URL function
Function compute url ($ url ){
$ Length = strlen ($ url );
If ($ length> 45 ){
$ Length = $ length-30;
$ First = substr ($ url, 0,-$ length );
$ Last =
Obtain the PHP code of the user's IP address
Function getRealIpAddr ()
{
If (! Empty ($ _ SERVER ['http _ CLIENT_IP ']) // check ip from share internet
{
$ Ip = $ _ SERVER ['http _ CLIENT_IP '
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