first, Chinese interception: mb_substr ()
Mb_substr ($str, $start, $length, $encoding)
$str, the string that needs to be truncated
$start, starting at 0 at the beginning of the truncation
$length, the number of words to intercept
$encoding, page
Find a workaround on the Web:
Copy CodeThe code is as follows:
/* Handling Json_encode Chinese garbled */
$data = Array (' Game ' = ' ice Fire country ', ' name ' = ' thorn spirit ', ' country ' + ' frost State ', ' level ' = 45);
echo Json_encode
Package download
pain.php
Copy CodeThe code is as follows:
Class Pain
{
Public $var =array ();
Public $tpl =array ();
The the method to assign VARs to the template
Public function assign ($variable, $value =null)
{
$this->var[$variable]= $value;
}
array_intersect () Definition and usage
The Array_intersect () function returns an array of intersections of two or more arrays.
The result array contains all of the values in the array that are being compared and also in all other parameter
This time support upload 2 images, upload the original image and poor quality diagram, the original image for the preservation of high-quality pictures, poor quality of the picture for the page display.
PHP Code
Copy CodeThe code is as
Krsort () Definition and usageThe Krsort () function reverses the array by key, preserving the original key for the set value.
The Second optional parameter contains an additional sort flag.
Returns TRUE if successful, otherwise FALSE is returned.
In general we will write this:
Copy CodeThe code is as follows:
if ($_get[' time ']==null)
{
$time = time ();
}
Else
{
$time = $_get[' time '];
}
Echo $time;
If get has time this value is brought into the variable.
?>
If only simple judgment,
Sort () Definition and usageThe sort () function sorts the values of the given array in ascending order.
Note: This function assigns the new key name to the cells in the array. The original key name is deleted.
Returns TRUE if successful,
Array_search () Definition and usage
The Array_search () function, like In_array (), looks for a key value in the array. If the value is found, the key name of the matching element is returned. Returns False if it is not found.
Before PHP 4.2.0,
So it is doubtful whether the coding problem, or the file permissions problem, or is not the function of the problem, after the investigation found that the original is WAN L1 host does not support Fsockopen, in the file uc_client/client.php
Array_key_exists () Definition and usageThe array_key_exists () function determines whether the specified key exists in an array, returns TRUE if the key exists, or false otherwise.
Grammar
Array_key_exists (Key,array)
Parameter description
Key is
Shuffle () Definition and usageThe shuffle () function rearranges the elements in the array in random order.
Returns TRUE if successful, otherwise FALSE is returned.
Note: This function assigns the new key name to the cells in the array. This will
Array_keys () Definition and usageThe Array_keys () function returns a new array that contains all the key names in the array.
If the second argument is supplied, only the key name of the value is returned.
If the strict parameter is specified as
Array_combine () Definition and usageThe Array_combine () function creates a new array by merging two arrays, one of which is the key name and the value of the other array is the key value.
If one of the arrays is empty, or if the number of
At that time to obtain video length is the use of Web-based universal access to FLV video file length method, but this method only for FLV video support, other formats of video to get the value is very poor,
Here is an introduction: the use of
problem description; Get the thumbnail and video time length of FLV video
Google a half-day discovery can use FFmpeg to get some information about the video, first introduce FFMEPG
Here's a quick look: FFmpeg is a complete solution for
So, the first chapter, reusable class code to paste out, easy to consult later and to provide the necessary friends.
: User class, including read and set database, and save change interaction
Copy CodeThe code is as follows:
Class user{
Private
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