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
PHP Articles
Page 75 of 81
sqrt() function in PHP
The sqrt() function in PHP returns the square root of a number. It accepts any numeric value and returns a float representing the square root. Syntax sqrt(num) Parameters num − The number for which you want to find the square root. Can be an integer or float. Return Value The sqrt() function returns the square root of the specified number as a float. For negative numbers, it returns NAN (Not a Number). Examples Basic Square Root Finding the square root of a perfect square ? ...
Read Moresinh() function in PHP
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 Morezip_read() function in PHP
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 Morezip_open() function in PHP
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 Morezip_entry_read() function in PHP
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 Morezip_entry_open() function in PHP
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 Morezip_entry_name() function in PHP
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 Morezip_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 More