Category: PHP

PHP uasort() Function

The uasort() function sorts an array by values using a user-defined comparison function. TRUE on success. FALSE on failure Tip: Use the uksort() function to sort an array by keys using a user-defined comparison function. Parameter Description array Required. Specifies the array to sort myfunction Optional. A string that define a callable comparison function. The comparison function […]

PHP array_reverse() Function

The array_reverse() function returns an array in the reverse order. The array_reverse() function is used to reverse the order of the elements in an array. PHP array_reverse() Function has the following syntax. Parameter Description array Required. Specifies an array preserve Optional. Specifies if the function should preserve the keys of the array or not.Possible values:truefalse Syntax […]

PHP array_pop() Function

The array_pop function is used to remove the last array element. This function has to use one argument that is array name and also this array function return one returns values. Note: This function will reset() the array pointer of the input array after use. Parameter Description array Required. Specifies an array Syntax Example Output

PHP array_splice() Function

This function removes the elements designated by offset and length from the input array, and replaces them with the elements of the replacement array, if supplied. It returns an array containing the extracted elements. Note: The keys in the replaced array are not preserved. Parameter Description array Required. Specifies an array start Required. Numeric value. […]

PHP array_intersect() Function

The array_intersect() function compares the values of two (or more) arrays, and returns the matches. This function compares the values of two or more arrays, and return an array that contains the entries from array1 that are present in array2, array3, etc. Parameter Description array1 Required. The array to compare from array2 Required. An array […]

PHP array_unshift() Function

The array_unshift() is used to add one or more elements to the beginning of an array. Tip: You can add one value, or as many as you like. Note: Numeric keys will start at 0 and increase by 1. String keys will remain the same. Parameter Description array Required. Specifying an array value1 Required. Specifies […]

PHP htmlspecialchars_decode() Function

The htmlspecialchars_decode() function converts some predefined HTML entities to characters. The htmlspecialchars_decode() function is the opposite of htmlspecialchars(). You may also like PHP html_entity_decode() Function and How to Encode and Decode URL Using PHP. Example The HTML output of the code above will be (View Source): Output

PHP array_fill() Function

The array_fill() function is used to fill an array with values. The function fills an array with num entries of the value of the array_values parameter, keys starting at the starting_index parameter. you can see below there Parameters and Descriptions. Parameter Description index Required. The first index of the returned array number Required. Specifies the […]

PHP array_diff() Function

The array_diff() function compares the values of two (or more) arrays, and returns the differences. You can diff several arrays by providing more parameters. The function will return an array of values in the first array that do not appear in the second and subsequent arrays. Parameter Description array1 Required. The specified array which will […]