Category: PHP

How to check if string is URL or not in PHP?

Sometimes, we require to check the given argument or string is URL or not, as specially i did need to check image column is url or not like i give you example how to do this. If you also need to do this then you can use filter_var(). Example: if(filter_var($imagePath, FILTER_VALIDATE_URL) === FALSE){ print_r("Not valide

How to generate random unique string in PHP?

Using str_shuffle() Function: The str_shuffle() function is an inbuilt function in PHP and is used to randomly shuffle all the characters of a string passed to the function as a parameter. When a number is passed, it treats the number as the string and shuffles it. This function does not make any change in the original

PHP | Gmagick clear() Function

The Gmagick::clear() function is an inbuilt function in PHP which is used to clear all resources associated to Gmagick object. Syntax: Gmagick Gmagick::clear( void )  Parameters: This function does not accepts any parameter. Return Value: This function returns the cleared Gmagick object. Errors/Exceptions: This function throws GmagickException on error. Below programs illustrate the Gmagick::clear() function in PHP: Example : <?php    //

PHP | Gmagick setimageprofile() Function

The Gmagick::setimageprofile() function is an inbuilt function in PHP which is used to add a named profile to the Gmagick object. Syntax: Gmagick Gmagick::setimageprofile( string $name, string $profile ) Parameters: This function accepts two parameters as mentioned above and described below: $name: It specifies the name of the profile. $profile: It specifies the value of the profile. Return Value: This function

PHP | ImagickPixel getHSL() function

The ImagickPixel::getHSL() function is an inbuilt function in PHP which is used to get the normalized HSL color described by the ImagickPixel object, with each being floating-point numbers between 0 and 1. HSL stands for hue, saturation, and luminosity. In general, hue decides what color is of the pixel whereas saturation decides the intensity of color further