Articles on Trending Technologies

Technical articles with clear explanations and examples

deg2rad() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 139 Views

The deg2rad() function converts degree values to their radian equivalents. Radians are the standard unit of angular measurement used in many mathematical calculations, while degrees are more commonly used in everyday applications. Syntax deg2rad(number) Parameters number − The degree value to be converted to radians. Accepts integer or float values. Return Value Returns a float representing the radian equivalent of the specified degree value. Example 1: Basic Conversion Here's how to convert a single degree value to radians − 360 degrees converted ...

Read More

dechex() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 144 Views

The dechex() function converts decimal numbers to their hexadecimal representation. It returns the hexadecimal string equivalent of the specified decimal value. Syntax dechex(number) Parameters number − The decimal value to be converted. Can be an integer or numeric string. Return Value Returns a string containing the hexadecimal representation of the given decimal number. Example Here's how to convert decimal numbers to hexadecimal format − f 7c6 ff 0 Working with Different Number Types The function accepts both integers and numeric strings −

Read More

decbin() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 142 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

cosh() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 170 Views

The cosh() function in PHP returns the hyperbolic cosine of a number. This mathematical function is useful for calculations involving exponential growth and decay, catenary curves, and engineering applications. Syntax cosh(number) Parameters number − A numeric value for which to calculate the hyperbolic cosine. The value should be in radians. Return Value Returns a floating-point number representing the hyperbolic cosine of the input value. The result is always positive since cosh(x) = cosh(-x). Examples Basic Usage Here's how to calculate the hyperbolic cosine of positive and negative ...

Read More

ceil() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 322 Views

The ceil() function rounds a number up to the nearest greater integer. This function always rounds up, regardless of the decimal value. Syntax ceil(number) Parameters number − The numeric value to round up Return Value Returns the value rounded up to the nearest integer as a float. Example 1: Basic Usage Here's how ceil() works with positive decimal numbers ? 1 1 3 Example 2: Whole Numbers When applied to whole numbers, ceil() returns the same value ? ...

Read More

bindec() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 151 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

base_convert() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 152 Views

The base_convert() function converts a number from one base to another, for example, octal number to decimal number. The base mentioned here should be between 2 and 36. Digits in numbers with a base greater than 10 are represented with the letters a-z, where a is 10, b is 11, c is 12, d is 13, and so on up to z which is 35. Syntax base_convert(num, original_base, to_base) Parameters num − The number to convert (as a string) original_base − The original base of the number (between 2 and 36) to_base − ...

Read More

atan2() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 169 Views

The atan2() function in PHP returns the arc tangent of two variables. It calculates the angle in radians between the positive x-axis and the ray from the origin to the point (val2, val1). Syntax atan2(y, x) Parameters y − The y-coordinate (dividend) x − The x-coordinate (divisor) Return Value The atan2() function returns the arc tangent of y/x in radians. The returned value is between -π and π, which represents the angle from the positive x-axis to the point (x, y). Example 1 Basic usage with positive values ...

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

How can we write PHP script to get the list of MySQL database?

Priya Pallavi
Priya Pallavi
Updated on 15-Mar-2026 2K+ Views

We can write PHP scripts to get the list of available MySQL databases using different approaches. Since the legacy MySQL extension is deprecated, we'll show modern methods using MySQLi and PDO. Using MySQLi Extension The MySQLi extension provides a simple way to list databases − Using PDO Extension PDO provides a more secure and flexible approach − Comparison Method Security Status Legacy MySQL Low Deprecated MySQLi High Active PDO High Active (Recommended) Conclusion Use ...

Read More
Showing 1–10 of 61,284 articles
« Prev 1 2 3 4 5 6129 Next »
Advertisements