PHP Array_chunk () function
Definitions and usageA series of array_chunk () functions splits into a new array.
Grammar
Array_chunk (Array,size,preserve_key) Parameter Description array Required. Specifies the array to use size Required.
Connecting to a database$link _id = mysql_connect ("localhost", "root", "") or Die ("Connection failed");if ($link _id){mysql_select_db ("My_test");if (!$_get[id]){
$result =mysql_query ("SELECT * from UserInfo");echo " number User name Sex Age
Syntax: void set_time_limit (int seconds)Note: When PHP is executed in safe mode, set_time_limit () will not produce any results, unless it is disabled in safe mode or modified in the structure file (in PHP3, it is called php3.ini, PHP4 is called
The code is as follows:Copy code Class Person{Private $ __data = array (); Public function _ get ($ property) {If (isset ($ this->__ data [$ property]) {Return $ this->__ data [$ property]; }Else {Return false; } } Public function _ set ($
Object assignment and copying: value assignment: reload using the "=" operator The code is as follows:Copy code User a (10), B;B =;Copy: Call the copy constructor.User B;User a (B );OrUser a = B; // equivalent to User a (B ); The difference
1. strstr-first appearance of the search stringString strstr (string $ haystack, mixed $ needle [, bool $ before_needle = false])Note 1: $ haystack is the string and $ needle is the string to be searched. This function is case sensitive.Note 2: The
The mktime () function is very useful for date calculation and validation. It automatically calculates the correct value for an input out of the range: The code is as follows:Copy code ");Echo (date ("M-d-Y", mktime (,). " ");Echo (date ("M-d-Y"
Is_file-Tells whether the filename is a regular fileUsage ps教程is dc-description">BoolIs_file(String$ Filename) $ File is a required parameter.Let's take a look at a classic is_file test instance.Var_dump(is_file('a_file.txt '))."";Var_dump (is_file
& This is a bitwise AND operator.& OperatorView and instance $ A = 11;$ B = 7;Printf ("% B & % B = % B", $ a, $ B, $ a & $ B );// Output:// 1011 & 111 = 11// Check again & instanceIf (TRUE & TRUE)If (1 & 0 = 0)Print "TRUE! ";// TRUEOriginal
Syntax: Boolean switch Directory (string directory) dirDirectory Changes to. Changes current working directory.Returns true upon success. If an error occurs, FALSE is returned.ExampleIf (chdir ("upload ")){Print "Changed current directory
Php imagecolorallocateImagecolorallocate-assign a color imageInt imagecolorallocate (resource $ image, int $ red, int $ green, int $ blue)Returns the color of a given RGB component.Imagecolorallocate () must be called to create each color, which
PHP session variables are used to store user session information or change settings. The Session variable contains about a single user information and is provided to all pages of an application.PHP session variablesWhen you work with the application,
Extract(PHP 4 and PHP 5)Extract-import to the current variable symbol table from an arrayDescriptionExtract (array $ var_array [Abstract $ extract_type = EXTR_OVERWRITE [, string $ prefix])Imports an array of variables to the current symbol
Array_map("= 4.0.6, PHP 5" in PHP 4)Array_map-array of considerations for various elements of callbackDescriptionArray array_map (callback $ callback, array $ arr1 [, array $...])Array_map () returns all content contained in an array. The callback
Array_unshift(PHP 4 and PHP 5)Array_unshift-Prepend the beginning of one or more elements, an arrayDescriptionInternational array_unshift (array & $ array, mixed: $ var [, mixed $...])Array_unshift () prepends uses the front array of elements. Note
Php_ini_loaded_file("= 5.2.4" in PHP 5)Php_ini_loaded_file-the retrieval path loads the php. Ini file.DescriptionString php_ini_loaded_file (invalid)Check if the php. Ini file is in and retrieve its path.ParametersThis function has no
Parameter or set_time_limit(PHP 4 and PHP 5)The parameter or set_time_limit-limits the maximum execution time.DescriptionInvalid parameter or set_time_limit (seconds)Set the number of seconds for the script to run. If this is done, the script
Umask value(PHP 4 and PHP 5)Umask-changed the current umaskDescriptionInterpreted umask ([International $ mask])Set the umask value of PHP to mask and 0777, and return the old umask. When PHP is used as a server module and umask is restored, each
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