Programming Articles

Page 1076 of 2547

zip_read() function in PHP

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

The zip_read() function reads the next entry in a ZIP file archive. It iterates through entries sequentially, returning a resource for each file or directory found within the archive. Syntax zip_read(zip) Parameters zip − The zip resource to read, opened with zip_open() Return Value The zip_read() function returns a resource containing a file within the zip archive on success, or FALSE when there are no more entries to read. Example The following example demonstrates reading entries from a ZIP file. We have a zip file "new.zip" with the ...

Read More

zip_open() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 132 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_read() function in PHP

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

The zip_entry_read() function is used to get the contents from an open zip archive file entry in PHP. Syntax zip_entry_read(zip_entry, len) Parameters zip_entry − The zip entry resource. Required. len − The length in bytes to read. Optional, defaults to 1024. Return Value Returns the contents from an open zip archive file entry as a string. Returns FALSE on failure. Example Let's say we have a zip file "one.zip" containing a single file "detail.txt" with the following content − Asia is a continent! Here's ...

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_name() function in PHP

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

The zip_entry_name() function returns the name of a directory entry inside a ZIP archive. This function is part of PHP's ZIP extension and works with ZIP archives opened using zip_open(). Syntax zip_entry_name(zip_entry) Parameters zip_entry − A directory entry resource from a ZIP file, obtained using zip_read() on an archive opened with zip_open(). Return Value The zip_entry_name() function returns the name of the ZIP archive entry as a string on success, or FALSE on failure. Example The following example demonstrates how to list all file names in a ZIP ...

Read More

zip_entry_compressed_size() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 116 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

zip_entry_close() function in PHP

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

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 More

sin() function in PHP

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

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 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

pow() function in PHP

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

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 More
Showing 10751–10760 of 25,466 articles
Advertisements