PHP array_chunk() example

Posted by Prem Tiwari | Updated on | in PHP Documentation.


PHP array_chunk() — Split an array into chunks. Chunks an array into arrays with size elements. The last chunk may contain less than size elements. Syntax: Returns a multidimensional numerically indexed array, starting with zero, …

PHP array_shift() example

Posted by Prem Tiwari | Updated on | in PHP Documentation.


array_shift — Shift an element off the beginning of array. array_shift() shifts the first value of the array off and returns it, shortening the array by one element and moving everything down. All numerical array …

PHP array_unshift() example

Posted by Prem Tiwari | Updated on | in PHP Documentation.


array_unshift — Prepend one or more elements to the beginning of an array. array_unshift() prepends passed elements to the front of the array. Note that the list of elements is prepended as a whole, so …

PHP ltrim() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


This function returns a string with whitespace stripped from the beginning of str. Without the second parameter, ltrim() will strip these characters: Syntax: Example #1 Usage example of ltrim()

PHP rtrim() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


This function returns a string with whitespace (or other characters) stripped from the end of str. Without the second parameter, rtrim() will strip these characters: Example #1 Usage example of rtrim() Output:

PHP trim() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


This function returns a string with whitespace stripped from the beginning and end of str. Without the second parameter, trim() will strip these characters: Another example: Remove newlines (\n) from both sides of the string:

PHP htmlspecialchars_decode() Function

Posted by Editorial Staff | Updated on | in PHP Documentation.


htmlspecialchars_decode() function convert special HTML entities back to characters. This function is the opposite of htmlspecialchars(). It converts special HTML entities back to characters. Syntax: Reference: https://www.php.net/manual/en/function.htmlspecialchars-decode.php

PHP html_entity_decode() Function

Posted by Editorial Staff | Updated on | in PHP Documentation.


PHP html_entity_decode() function convert HTML entities to their corresponding characters. html_entity_decode() is the opposite of htmlentities() in that it converts HTML entities in the string to their corresponding characters. Description: More precisely, this function decodes …

PHP trigger_error() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


The set_exception_handler() is an inbuilt function of PHP and is used to generates a user-level error/warning/notice message. It will returns FALSE if wrong error_type is specified, TRUE otherwise. PHP trigger_error() function example Example #1 trigger_error() function example Example #2 trigger_error() function …

PHP set_exception_handler() function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


The set_exception_handler() is an inbuilt function of PHP and is used to sets a user-defined exception handler function. It will returns the name of the previously defined exception handler, or NULL on error. If no previous …

PHP error_get_last() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


The error_get_last() is an inbuilt function of PHP and is used to return the last error that occurred in your program. Returns an associative array describing the last error with keys: type, message, file, and …

PHP array_key_first() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


The array_key_first() is an inbuilt function of PHP and is used to gets the first key of an array. You can get the first key from given array without affecting the internal array pointer. Syntax: …

PHP array_key_exists() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


The array_key_exists() is an inbuilt function of PHP and is used to checks if the given key or index exists in the array. array_key_exists() returns TRUE if the given key is set in the array. key can be any value possible …

PHP array_flip() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


The array_flip() is an inbuilt function of PHP and is used to exchanges all keys with their associated values in an array. array_flip() returns an array in flip order, i.e. keys from array become values and values from array become keys. array_flip() …

PHP | array_slice() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


array_slice() is an inbuilt function of PHP library and it is used to slice an array according tot the user needs. array_slice() — It returns the sequence of elements from the array array as specified …