Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

Page 27 of 81

How to specify Decimal Precision and scale number in MySQL database using PHPMyAdmin?

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 2K+ Views

When working with DECIMAL data types in MySQL through PHPMyAdmin, you need to specify both precision and scale to properly store monetary values or other exact numeric data. This tutorial shows you how to configure decimal precision and scale using PHPMyAdmin interface. Understanding DECIMAL Precision and Scale The DECIMAL data type requires two parameters: DECIMAL(precision, scale) Where: Precision (X) − Total number of digits that can be stored Scale (Y) − Number of digits after the decimal point Example of DECIMAL Usage For DECIMAL(6, 4): Total digits: 6 Digits ...

Read More

imageconvolution() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 188 Views

The imageconvolution() function in PHP applies a convolution matrix to an image resource. This function is used for image filtering effects like sharpening, blurring, edge detection, and embossing. Syntax bool imageconvolution(resource $image, array $matrix, float $div, float $offset) Parameters image − An image resource created by functions like imagecreatetruecolor() or imagecreatefromgif(). matrix − A 3x3 matrix represented as an array of three arrays, each containing three float values. div − The divisor used for normalization of the convolution result. Used to control the brightness of the output. offset − Color offset value added ...

Read More

imagecopymerge() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 878 Views

The imagecopymerge() function copies and merges part of one image onto another with specified transparency. This function is useful for creating watermarks, overlays, or blending images together. Syntax imagecopymerge(dst_img, src_img, dst_x, dst_y, src_x, src_y, src_w, src_h, pct) Parameters dst_img − Destination image resource src_img − Source image resource dst_x − X-coordinate of destination point dst_y − Y-coordinate of destination point src_x − X-coordinate of source point src_y − Y-coordinate ...

Read More

imagechar() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 206 Views

The imagechar() function in PHP draws a single character horizontally on an image. This function is useful for adding text elements to dynamically generated images. Syntax bool imagechar(resource $image, int $font, int $x, int $y, string $c, int $color) Parameters image − An image resource created by functions like imagecreate() or imagecreatetruecolor() font − Font size (1-5 for built-in fonts, or a loaded font identifier) x − x-coordinate for the character position y − y-coordinate for the character position c − The character to draw (only the first character of the string is ...

Read More

imagecolorallocate() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 642 Views

The imagecolorallocate() function in PHP allocates a color for an image using RGB values. This function is essential for creating colored graphics and backgrounds in image manipulation. Syntax int imagecolorallocate($image, $red, $green, $blue) Parameters $image: Image resource created with imagecreatetruecolor() or imagecreate() $red: Red color component (0-255) $green: Green color component (0-255) $blue: Blue color component (0-255) Return Value Returns a color identifier on success, or FALSE on failure. The color identifier can be used with other image functions. Example Here's how to create an image with a ...

Read More

imagecreate() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 7K+ Views

The imagecreate() function is used to create a new palette−based image resource in PHP. While functional, it's recommended to use imagecreatetruecolor() instead for better image quality, as it creates true color images that support millions of colors rather than the 256−color palette limitation of imagecreate(). Syntax imagecreate($width, $height) Parameters Parameter Type Description $width int The width of the image in pixels $height int The height of the image in pixels Return Value Returns an image resource identifier on success, or FALSE on failure. ...

Read More

getimagesize() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 3K+ Views

The getimagesize() function in PHP is used to retrieve the dimensions and other information about an image file. It can work with both local files and remote URLs, returning an array containing width, height, image type, and additional metadata. Syntax getimagesize(file_name, img_info) Parameters file_name − The path to the image file (local or remote URL) img_info (optional) − An array to store extended information from the image file. Currently supports only JFIF files Return Value The function returns an indexed array with the following elements ? [0] − ...

Read More

php_strip_whitespace() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 152 Views

The php_strip_whitespace() function returns PHP source code with stripped comments and whitespace, making it useful for code optimization and analysis. Syntax php_strip_whitespace(file_path) Parameters file_path − The path to the PHP file to be processed. Return Value The php_strip_whitespace() function returns the stripped source code as a string on success, or FALSE on failure. Example Let's create a sample PHP file and then use php_strip_whitespace() to process it ? Now, let's strip the whitespace and comments ? ...

Read More

highlight_file() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 281 Views

The highlight_file() function outputs a file with the PHP syntax highlighted using colors. It's useful for displaying PHP source code in a readable, formatted way on web pages. Syntax highlight_file(file, return) Parameters file − The file name to display. Can be a relative or absolute path to the PHP file. return − Optional boolean parameter. If set to true, the function returns the highlighted code as a string instead of printing it directly. Default is false. Return Value Returns true on success or false on failure when the return parameter ...

Read More

exit() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 1K+ Views

The exit() function in PHP prints a message and terminates the current script execution immediately. It can accept an optional message parameter to display before exiting. Syntax exit(msg) Parameters msg − Optional. The message to display before exiting the script. Can be a string or an integer exit status code. Return Value The exit() function does not return any value as it terminates script execution. Example 1: Basic Usage Here's a simple example showing how exit() works − Before exit Script terminated! Example 2: File Operation with Error Handling The exit() function is commonly used for error handling when operations fail −

Read More
Showing 261–270 of 810 articles
« Prev 1 25 26 27 28 29 81 Next »
Advertisements