Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
PHP deg2rad() Function
The deg2rad() function in PHP converts angles from degrees to radians. This function is essential when working with trigonometric functions like sin(), cos(), and tan(), which require angle arguments in radians rather than degrees. Syntax deg2rad(float $number) : float Parameters Parameter Description number A float number representing angle in degrees Return Value Returns a float number representing the angle in radians. The conversion follows the formula: radians = degrees × π/180. Example Here's how to convert degrees to radians using deg2rad() − ...
Read MorePHP dechex() Function
The dechex() function converts a decimal number to its hexadecimal representation and returns it as a string. This function is particularly useful for color codes, memory addresses, and low-level programming operations. Syntax dechex ( int $number ) : string Parameters Parameter Description number A decimal number to be converted to hexadecimal representation Return Value Returns a string containing the hexadecimal representation of the given decimal number. Example 1: Basic Usage Converting positive decimal numbers to hexadecimal ? a ...
Read MorePHP decbin() Function
The decbin() function converts a decimal number to its binary representation and returns it as a string. This function is useful for displaying numbers in binary format or for bitwise operations. Syntax decbin ( int $number ) : string Parameters Parameter Description number A decimal number to be converted to binary representation Return Value Returns a string containing the binary representation of the given decimal number. Examples Basic Usage Here's how to convert positive decimal numbers to binary ? ...
Read MorePHP cos() Function
The cos() function returns the cosine ratio of given angle in radians. In trigonometry, cosine of an angle is defined as ratio of lengths of adjacent side and hypotenuse. cos(x) = adjacent/hypotenuse If x=90 degrees (π/2 radians), cos(x) = 0. This function returns a float value. Syntax cos ( float $arg ) : float Parameters Parameter Description arg A floating point value that represents angle in radians Return Value PHP cos() function returns cosine ratio of given parameter as a float. Examples ...
Read MorePHP ceil() Function
The ceil() function is a built-in mathematical function in PHP that rounds any float number up to the next highest integer. This function always returns a float number, as the range of float is larger than that of integer. Syntax ceil ( float $num ) : float Parameters Parameter Description num The number to be rounded up Return Value The ceil() function returns the smallest integer value (as float) that is greater than or equal to the given parameter. Examples Example 1: Basic Usage ...
Read MorePHP bindec() Function
The bindec() function converts a binary number represented as a string into its decimal equivalent. The binary string is interpreted as an unsigned integer, and invalid characters (other than 0 and 1) are ignored. Syntax bindec(string $binary_string): int|float Parameters Parameter Description binary_string A string containing binary digits (0 and 1). Invalid characters are ignored. Return Value Returns the decimal equivalent as an integer or float (for large numbers). Examples Basic Usage Converting a simple binary string to decimal ? ...
Read MorePHP asinh() Function
The asinh() function calculates the inverse hyperbolic sine of a given number. In mathematical terms, it returns the value whose hyperbolic sine equals the input parameter. The mathematical formula is: asinh(x) = log(x + sqrt(x² + 1)) Syntax asinh(float $arg): float Parameters Parameter Description arg A floating point value whose inverse hyperbolic sine is to be calculated Return Value Returns the inverse hyperbolic sine of the argument as a float value. Examples Basic Usage Here's a simple example using the value of ...
Read MorePHP acosh() Function
The acosh() function returns the inverse hyperbolic cosine of a given number. The inverse hyperbolic cosine is defined mathematically as: acosh(x) = log(x + sqrt(x² - 1)) This function accepts values greater than or equal to 1 and returns a float value representing the hyperbolic angle in radians. Syntax acosh(float $arg): float Parameters Parameter Description arg A floating point value ≥ 1 whose inverse hyperbolic cosine is to be calculated Return Value Returns the inverse hyperbolic cosine of arg as a float, or NAN ...
Read MorePHP abs() Function
The abs() function is a built-in PHP function that returns the absolute value of a number. The absolute value is always positive, regardless of whether the input is positive or negative. Syntax abs(mixed $number) Parameters Parameter Description number The numeric value to process (int, float, or numeric string) Return Value Returns the absolute value of the number. If the parameter is a float, the return type is float. For integer parameters, the return type is integer. Examples Basic Usage with Numbers ...
Read MoreDifference between bindParam and bindValue in PHP
Both bindParam() and bindValue() are built-in PHP PDO methods used to bind variables to placeholders in prepared SQL statements. While they appear similar, they handle variable binding differently − one binds by reference, the other by value. Key Differences Sr. No. Key bindParam() bindValue() 1 Binding Type Binds by reference − uses variable's current value at execution Binds by value − captures value at bind time 2 When Value is Read At execute() time At bindValue() call time 3 Variable Changes Reflects changes made to variable after ...
Read More