PHP list() Function6 Jan 2025 | 1 min read The PHP list( ) function is used to assign values to a list of variables in one operation. This function was introduced in PHP 4.0. SyntaxParameter
ReturnsThe list( ) function returns the assigned array. Example 1Output: I have many cars like, a audi, a ford and a toyota. Example 2Output: Here I only use the audi and mercedes variables. Example 3Output: I am expert in php, javascript and html. Example 4Output: We have covered php and asp.net and so many other topics Next TopicPhp-array-map-function |
The array_key_last( ) function is used to get the last key of an array. This function was introduced in PHP 7.3.0 Syntax mixed array_key_last ( array $array ); Parameters Parameter Description Is compulsory array Specifies the array. compulsory Return Values The array_key_last( ) function returns the last key of the array if the array is not...
1 min read
PHP natcasesort() Function The natcasesort( ) function is used to sort an array using a case insensitive "natural array" algorithm. The function implements a sort algorithm but maintains original keys and values. This function was introduced in PHP 4.0. Syntax bool natcasesort ( array &$array ); Parameter Parameter Description Is compulsory array The input...
2 min read
The array_key_first( ) function is used to get the first key of an array. This function was introduced in PHP 7.3.0 Syntax mixed array_key_first ( array $array ); Parameters Parameter Description Is compulsory array Specifies the array. compulsory Return Values The array_key_first( ) function returns the first key of the array if the array is not...
1 min read
The array_merge( ) function is a built-in function of PHP. This function is used to merge the elements or values of two or more arrays together into a single array. This function was introduced in PHP 4.0. Syntax array array_merge(array $array1[, array $...]); Parameter Parameter Description Is compulsory array1 Specifies an array. compulsory array2 Specifies an...
1 min read
The array_intersect_uassoc( ) function is an inbuilt function in PHP. The array_intersect_uassoc( ) function is used to compare key and values of two or more arrays by using a user-defined comparison function and return the matches. It returns an array containing all the values of...
2 min read
The array_shift() function is an inbuilt function of PHP. The array_shift( ) function is used to remove the first element from an array, and returns the value of the removed element. This function was introduced in PHP 4.0. Syntax mixed array_shift ( array &$array ); Parameter Parameter Description Is compulsory array name The...
1 min read
The array_filter( ) function filters the values of an array using a callback function. This function passes each value of the input array to the callback function. If the callback function returns true, the current value from the input is returned into the result array....
2 min read
The array_combine() function is an inbuilt function in PHP. This function is introduced in PHP 5. It is used to create an array by using one array for keys and another for its values. Syntax array_combine(array_keys,array_values); Parameter Description Is compulsory array_keys The keys of the array to be used compulsory array_values The values of the...
1 min read
PHP uksort() Function The PHP uksort( ) function is used to sort an array by the elements keys using a user-defined comparison function. This function was introduced in PHP 4.0. Syntax bool uksort ( array &$array , callable $key_compare_func ); Parameter Parameter Description Is compulsory array Specifies the array to be sorted. compulsory user_defined_function This function is...
2 min read
The compact( ) function is an inbuilt function of PHP, and it is used to create an array from variables and their values. This function was introduced in PHP 4+. Syntax array compact ( mixed $varname1 [, mixed $... ] ); Parameters Parameter Description Is compulsory Variable1 It can be either a string...
1 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India