Category: PHP

PHP compact() Function

The compact() function creates an array from variables and their values. Note: Any strings that does not match variable names will be skipped. Can be a string with the variable name, or an array of variables. Multiple parameters are allowed. Parameter Description var1 Required. Can be a string with the variable name, or an array […]

curl request in udemy api using php and export data in excel file

To make any calls to Udemy REST API, you will need to create an API client. API client consists of a bearer token, which is connected to a user account on Udemy. To send authenticated requests, provide the client_id and client_secret values as a base64 encoded HTTP Authorization header. You may also like PHPExcel export mysql […]

PHP krsort() Function

The krsort() function sorts an associative array in descending order, according to the key. Tip: Use the ksort() function to sort an associative array in ascending order, according to the key. Tip: Use the arsort() function to sort an associative array in descending order, according to the value. Parameter Description array Required. Specifies the array to sort […]

PHP array_diff_assoc() Function

The array_diff_assoc() function is used to compare an array against another array and returns the difference. Unlike array_diff() the array keys are also used in the comparison. This function compares the keys and values of two (or more) arrays, and return an array that contains the entries from array1 that are not present in array2 or array3, […]

How to Compress HTML Code using PHP

Compressing the code is very beneficial for a website it increases website performance and load it faster by making webpage smaller and lighter and it also affects website SEO, so this script strips out all the line breaks and spaces in your code and puts it on one line, compressing your code and making it […]

PHP array_fill_keys() Function

It fills an array with the value of the value parameter, using the values of the keys array as keys. The function array_fill() is used to assign or fill mixed values to an array by declaring suitable number of elements in the array. Whereas the function array_fill_keys() is used to fill mixed values to an array corresponding […]

PHP rsort() Function

This rsort() function is used to sort an array in reverse order (highest to lowest). Note: If two members compare as equal, their relative order in the sorted array is undefined. TRUE on success. FALSE on failure Parameter Description array Required. Specifies the array to sort sortingtype Optional. Specifies how to compare the array elements/items. […]

PHP natcasesort() Function

The natcasesort() function sorts an array by using a “natural order” algorithm. The values keep their original keys. This function is case-insensitive. This function returns TRUE on success, or FALSE on failure. Parameter Description array Required. Specifies the array to sort Syntax