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 …

New Global Constants in php 7

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


Here is the list of New Global Constants in php 7. Below is the syntax how you can use PHP global variables inside your code. Examples to use PHP global variables Core Predefined Constants PHP_INT_MIN …

How to use a switch case ‘or’ in PHP?

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


Problem: How to use a switch case ‘or’ in PHP? Solution: This can be achieved in 2 ways. PHP Switch case syntax Use the switch statement to select one of many blocks of code to be executed. …