Category: PHP

PHP addcslashes() Function

The addcslashes() function is used to add backslashes in front of the specified characters in a string. Note : In PHP \0 (NULL), \r (carriage return), \n (newline), \f (form feed), \v (vertical tab) and \t (tab) are predefined escape sequences. Example Output

PHP Mysql DELETE Query

If you want to delete a record from any MySQL table, then you can use the SQL command DELETE FROM. To understand Delete query, consider an Customers table, which is having following query First you can need database connection in php Code

PHP array_merge() Function

The array_merge() function merges one or more arrays into one array. If the input arrays have matching string keys, then the later value will override it’s the previous counterpart. If the input arrays contain numeric keys, the later value will be appended instead of overriding the original value. If there is only one array, the […]

How to Submit Form Without Page Refresh using Ajax, jQuery

This tutorial will teach you about creating form that will submit information without refreshing the form page. The jQuery post() and get() methods are used for HTTP POST or GET request from the server. Instead, an notification message will display on successful submission. HTML and jQuery Code PHP Code (insertdata.php)

PHP array_flip() Function

The array_flip() function is used to exchange the keys with their associated values in an array. The function returns an array in flip order, i.e. keys from array become values and values from array become keys. Note: The values of the array need to be valid keys, i.e. they need to be either integer or […]

PHP array_combine() Function

The array_combine() function is used to creates an array by using one array for keys and another for its values. It returns the combined array, FALSE if the number of elements for each array isn’t equal or if the arrays are empty. Parameter Description keys Required. Array of keys values Required. Array of values Syntax […]

PHP array_reduce() Function

This function applies iteratively the function function to the elements of the array, so as to reduce the array to a single value. Note: If the array is empty and initial is not passed, this function returns NULL. Returns the resulting value Parameter Description array Required. Specifies an array myfunction Required. Specifies the name of […]

PHP array_sum() Function

It calculates the sum of values in an array and returns the sum of values in an array as an integer or float. PHP versions prior to 4.2.1 modified the passed array itself and converted strings to numbers (which often converted them to zero, depending on their value) Parameter Description array Required. Specifies an array […]