karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 53 of 143

min() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 162 Views

The min() function in PHP returns the minimum value from a given set of values or an array. It compares all provided values and returns the smallest one. Syntax min(arr_values); or min(val1, val2, ...); Parameters arr_values − An array containing the values to compare. val1, val2, ... − Individual values to compare (can pass multiple arguments). Return Value Returns the minimum value from the provided arguments or array. The return type matches the type of the smallest value. Example 1: Using ...

Read More

log1p() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 170 Views

The log1p() function in PHP returns log(1+number), computed in a way that is accurate even when the value of number is close to zero. This function is particularly useful for mathematical calculations involving logarithms of values near zero, where direct calculation of log(1+x) might lose precision. Syntax log1p(number) Parameters number − The numeric value to be processed. Must be greater than -1. Return Value Returns the natural logarithm of (1 + number) as a float. If the number is less than or equal to -1, the function returns NAN (Not ...

Read More

log() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 278 Views

The log() function in PHP calculates the natural logarithm (base e) of a number. It can also calculate logarithms with a specified base when provided as the second parameter. Syntax log(number, base) Parameters number − The value for which you want to calculate the logarithm (must be positive) base − Optional. The logarithmic base. If omitted, calculates natural logarithm (base e) Return Value Returns the logarithm of the number. Returns -INF for zero, NAN for negative numbers, and a float value for positive numbers. Examples Basic Natural Logarithm ...

Read More

is_nan() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 134 Views

The is_nan() function checks for 'not a number' value. It returns TRUE if the value is 'not a number', else FALSE is returned. Syntax is_nan(num) Parameters num − The value to check Return Value The is_nan() function returns TRUE if num is 'not a number', else FALSE is returned. Example 1 Here's a simple example checking if a number is NaN − false Example 2 Let us see another example with acos() function − ...

Read More

is_finite() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 108 Views

The is_finite() function checks if a value is finite or not. It returns true if the number is a finite number, else it returns false. Syntax is_finite(num) Parameters num − The number to be checked. Return Value The is_finite() function returns true if num is a finite number, else it returns false. Example 1: Finite Number Let's check if a regular number is finite ? true Example 2: Infinite Value Let's check if log(0) (which is negative infinity) is ...

Read More

floor() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 210 Views

The floor() function rounds a number down to the nearest integer. It always rounds towards negative infinity, which means positive decimals are rounded down and negative decimals are rounded further away from zero. Syntax floor(num) Parameters num − The number to round down Return Value The floor() function returns the value rounded down to the nearest integer as a float. Example 1 Basic usage with positive decimal numbers − 0 0 9 Example 2 Using floor() with whole numbers ...

Read More

exp() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 127 Views

The exp() function in PHP returns ex, where e is the mathematical constant (approximately 2.718282) raised to the power of x. This function is commonly used in mathematical calculations involving exponential growth, logarithms, and scientific computations. Syntax exp(x) Parameters x − A numeric value representing the exponent. Can be integer, float, or any numeric expression. Return Value Returns a float value representing e raised to the power of x (ex). If the result is too large to represent as a float, the function returns INF (infinity). Basic Examples ...

Read More

decbin() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 146 Views

The decbin() function converts a decimal number to its binary representation and returns the result as a string. Syntax decbin(num) Parameters num − The decimal number to be converted to binary. Can be an integer or string representation of a number. Return Value Returns a string containing the binary representation of the given decimal number. Example 1 Converting a decimal number to binary ? 111100011001 Example 2 Converting another decimal number to binary ? ...

Read More

bindec() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 155 Views

The bindec() function converts a binary number to its decimal equivalent. It takes a binary string as input and returns the corresponding decimal value. Syntax bindec(binary_string) Parameters binary_string − The binary string to convert. Must contain only 0s and 1s. Return Value The bindec() function returns the decimal value of the specified binary string. If the input contains invalid characters, it stops processing at the first invalid character. Examples Basic Conversion Here's a simple example converting binary to decimal ? 13 ...

Read More

PHP timestamp to HTML5 input type=datetime element

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 986 Views

HTML5 datetime input elements require a specific format: YYYY-MM-DDTHH:MM:SS. In PHP, you can convert timestamps to this format using the date() function with the appropriate format string. Basic DateTime Format To format the current timestamp for HTML5 datetime input − 2024-03-28T19:12:49 Converting Specific Timestamp To convert a specific Unix timestamp to HTML5 datetime format − 2022-01-01T00:00:00 HTML Integration Using the formatted timestamp in an HTML datetime input element −

Read More
Showing 521–530 of 1,421 articles
« Prev 1 51 52 53 54 55 143 Next »
Advertisements