Samual Sam

Samual Sam

1,507 Articles Published

Articles by Samual Sam

Page 56 of 151

ftp_cdup() function in PHP

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

The ftp_cdup() function in PHP changes the current directory to the parent directory on an FTP server. This is equivalent to the "cd .." command in Unix/Linux systems or "cd .." in Windows command prompt. Syntax ftp_cdup($ftp_connection) Parameters The function accepts the following parameter − ftp_connection − Required. The FTP connection resource returned by ftp_connect() Return Value The ftp_cdup() function returns TRUE on success or FALSE on failure. Example The following example demonstrates how to change the current directory to the parent directory − ...

Read More

sinh() function in PHP

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

The sinh() function returns the hyperbolic sine of a number, which is mathematically equivalent to (exp(num) - exp(-num))/2. This function is commonly used in mathematical calculations involving hyperbolic trigonometry. Syntax sinh(num) Parameters num − The number for which you want to calculate the hyperbolic sine. The value should be in radians. Return Value The sinh() function returns a float representing the hyperbolic sine of the given number. Example 1 Basic usage with simple numeric values ? 0 1.1752011936438 -1.1752011936438 Example ...

Read More

zip_open() function in PHP

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

The zip_open() function opens a ZIP file for reading in PHP. It returns a resource handle on success or FALSE on failure. This function is part of PHP's ZIP extension and allows you to read the contents of ZIP archives. Syntax zip_open(filename) Parameters The function accepts a single parameter ? filename − The path to the ZIP file that needs to be opened for reading. Return Value Returns a ZIP file resource handle on success, or FALSE on failure (e.g., if the file doesn't exist or is not a ...

Read More

zip_entry_open() function in PHP

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

The zip_entry_open() function is used to open a zip archive entry for reading. This function is part of PHP's legacy Zip extension and allows you to access individual files within a ZIP archive. Syntax zip_entry_open(zip_file, zip_entry, mode) Parameters zip_file − The zip file resource to be read zip_entry − The zip entry resource to open mode − The type of access needed for zip archive (e.g., "r" for read, "rb" for read binary) Return Value The zip_entry_open() function ...

Read More

zip_entry_compressed_size() function in PHP

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

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 More

rad2deg() function in PHP

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

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 More

pi() function in PHP

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

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 More

mt_srand() function in PHP

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

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 More

max() function in PHP

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

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

is_infinite() function in PHP

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

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

Read More
Showing 551–560 of 1,507 articles
« Prev 1 54 55 56 57 58 151 Next »
Advertisements