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
Server Side Programming Articles
Page 1063 of 2109
zip_entry_compressed_size() function in PHP
The zip_entry_compressed_size() function returns the compressed file size of a zip archive entry. This function is part of PHP's legacy ZIP extension and is used to retrieve the size of compressed files within a ZIP archive. Syntax zip_entry_compressed_size(zip_entry) Parameters zip_entry − The zip entry resource obtained from zip_read(). Required. Return Value Returns the compressed file size in bytes as an integer, or FALSE on failure. Example The following example demonstrates how to get the compressed size of files in a ZIP archive ? ...
Read Morezip_entry_close() function in PHP
The zip_entry_close() function is used to close a zip archive entry that was previously opened by the zip_entry_open() function. This function is part of PHP's Zip File Functions extension. Syntax zip_entry_close(zip_entry) Parameters zip_entry − The zip entry resource that was opened using zip_entry_open(). Required. Return Value The zip_entry_close() function returns TRUE on success and FALSE on failure. Example The following example demonstrates how to use zip_entry_close() to properly close a zip entry after reading it ? filename.txt closed successfully! Key ...
Read Moresin() function in PHP
The sin() function in PHP returns the sine of a number. It accepts a numeric value in radians and returns the corresponding sine value as a floating-point number. Syntax sin(number) Parameters number − A numeric value in radians for which you want to calculate the sine. Return Value The sin() function returns the sine of the given number as a float. The return value ranges between -1 and 1. Example 1 Here's a basic example demonstrating the sin() function with different radian values − ...
Read Morerad2deg() function in PHP
The rad2deg() function converts radian values to degree values. It returns the equivalent of a radian value in degrees, making it useful for mathematical calculations and geometric computations. Syntax rad2deg(val) Parameters val − The radian value to be converted into degrees. This should be a numeric value representing an angle in radians. Return Value The rad2deg() function returns the equivalent of the input value in degrees as a float. Example 1: Converting Pi Radians Converting π radians (180 degrees) to degrees − ...
Read Morepow() function in PHP
The pow() function in PHP calculates the power of a number by raising the base to the specified exponent. It handles positive, negative, and floating-point values. Syntax pow(base, exponent) Parameters base − The base number (can be integer or float) exponent − The exponent to raise the base to (can be integer or float) Return Value Returns the result of base raised to the power of exponent. Returns NAN for invalid operations like negative base with fractional exponent. Example 1: Basic Power Calculation Calculate 3 raised to the ...
Read Morepi() function in PHP
The pi() function returns the value of Pi (π), which is approximately 3.1415926535898. This mathematical constant represents the ratio of a circle's circumference to its diameter. Syntax pi() Parameters The pi() function takes no parameters. Return Value Returns the approximate value of PI as a floating-point number: 3.1415926535898. Example Here's a basic example using the pi() function − 3.1415926535898 Using M_PI Constant PHP also provides the M_PI predefined constant as an alternative to the pi() function − ...
Read Moreoctdec() function in PHP
The octdec() function converts an octal number to its decimal equivalent. This function is useful when working with octal representations in PHP. Syntax octdec(octal_string) Parameters octal_string − A string containing the octal number to convert. Can include negative sign for negative numbers. Return Value The octdec() function returns the decimal equivalent of the specified octal number as an integer. Example 1: Basic Octal to Decimal Conversion Here's how to convert a simple octal number to decimal − 80 120 Example ...
Read Moremt_srand() function in PHP
The mt_srand() function seeds the Mersenne Twister random number generator in PHP. This function allows you to initialize the random number generator with a specific seed value, ensuring reproducible random number sequences. Note − Random number generator is seeded automatically after the release of PHP 4.2.0. This function is not needed now unless you want predictable random sequences. Syntax mt_srand(seed) Parameters seed − Optional integer value used to initialize the random number generator. If omitted, a random seed is used. Return Value The mt_srand() function ...
Read Moremin() function in PHP
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 Moremax() function in PHP
The max() function in PHP returns the maximum value from a set of values or an array. It accepts either multiple individual values or a single array as input. Syntax max(value1, value2, value3, ...) max(array_values) Parameters value1, value2, ... − Individual values to compare (can be numbers or strings). array_values − An array containing values to compare. Return Value Returns the maximum value found. For string comparisons, it uses lexicographical ordering. Example 1: Using Multiple Values Finding the maximum among individual numeric values − ...
Read More