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 by karthikeya Boyini
Page 56 of 142
ftp_pasv() function in PHP
The ftp_pasv() function in PHP enables or disables passive mode for FTP connections. Passive mode allows the client to initiate data connections, which is often required when working behind firewalls or NAT routers. Syntax ftp_pasv(connection, pasv) Parameters connection − The FTP connection resource returned by ftp_connect() pasv − A boolean value that specifies the passive mode state − TRUE − Enable passive mode ...
Read Moreftp_nb_fput() function in PHP
The ftp_nb_fput() function uploads data from an open file pointer to a file on the FTP server using non-blocking mode. This allows your script to continue processing while the upload happens in the background. Syntax ftp_nb_fput(con, remote_file, open_file, transfer_mode, beg_pos); Parameters con − The FTP connection resource remote_file − The remote file path on the FTP server open_file − The file pointer resource opened with fopen() transfer_mode − The transfer mode. Possible values: − FTP_ASCII for text files − FTP_BINARY for binary files beg_pos − (Optional) The position to start uploading from ...
Read Moreftp_nb_continue() function in PHP
The ftp_nb_continue() function continues to receive or send a file to the FTP server in non-blocking mode. This function is used with non-blocking FTP operations to check the status and continue the transfer process. Syntax ftp_nb_continue($ftp_connection); Parameters ftp_connection − The FTP connection resource created by ftp_connect(). Return Value The ftp_nb_continue() function returns one of the following constants − FTP_FAILED − The transfer failed FTP_FINISHED − The transfer completed successfully FTP_MOREDATA − The transfer is still in progress Example The following example shows how to use ...
Read Moreftp_get_option() function in PHP
The ftp_get_option() function retrieves runtime configuration options for an established FTP connection, allowing you to check current settings like timeout values and autoseek behavior. Syntax ftp_get_option(connection, option); Parameters connection − The FTP connection resource returned by ftp_connect(). option − The runtime option to retrieve. Available constants: FTP_TIMEOUT_SEC − Returns the current network timeout in seconds FTP_AUTOSEEK − Returns TRUE if autoseek is enabled, FALSE otherwise Return Value Returns the option value on success, or FALSE if the specified option is not supported or the connection is invalid. ...
Read Moreftp_fget() function in PHP
The ftp_fget() function downloads a file from an FTP server and saves it directly into an open local file resource. This function is useful when you need to download files from a remote FTP server and store them locally. Syntax ftp_fget(con, open_file, server_file, mode, startpos); Parameters con − The FTP connection resource created by ftp_connect() open_file − An open file resource where the downloaded data will be stored server_file − The path to the file on the FTP server to download mode − The transfer mode (FTP_ASCII or FTP_BINARY) startpos − The position ...
Read Moreftp_close() function in PHP
The ftp_close() function in PHP is used to close an active FTP connection that was previously established using ftp_connect(). This function helps free up system resources and properly terminates the connection. Syntax ftp_close($connection); Parameters $connection − The FTP connection resource to close, returned by ftp_connect(). Return Value The ftp_close() function returns TRUE on success or FALSE on failure. Example The following example demonstrates connecting to an FTP server, performing directory operations, and properly closing the connection − Key Points Always close ...
Read Moreftp_alloc() function in PHP
The ftp_alloc() function allocates space for a file to be uploaded to the FTP server. This function is useful when uploading large files to ensure sufficient disk space is available on the server before attempting the transfer. Syntax ftp_alloc(connection, size_of_file, res); Parameters connection − The FTP connection resource to use size_of_file − The number of bytes to allocate on the server res − Optional variable to store the server response message Return Value The ftp_alloc() function returns TRUE on success or FALSE on failure. Example The following example ...
Read Moretan() function in PHP
The tan() function in PHP returns the tangent of a specified value in radians. It's a built-in mathematical function that calculates the ratio of sine to cosine for a given angle. Syntax tan(value) Parameters value − A numeric value representing an angle in radians (float or integer) Return Value The tan() function returns a float representing the tangent of the specified angle. Returns NaN for invalid inputs. Basic Examples Here are some basic examples demonstrating the tan() function ? 01.55740772465491 ...
Read Moresqrt() 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 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 More