Found 1046 Articles for PHP

ftp_close() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

49 Views

The ftp_close() function closes an FTP connection.Syntaxftp_close(con);Parameterscon − The connection to close.ReturnThe ftp_close() function returns TRUE on success or FALSE on failureExampleThe following is an example that login to a connection, works in it to change the directory and then connection is closed −

ftp_chmod() function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

71 Views

The ftp_chmod() function set permissions on a remote file via FTP.Syntaxftp_chmod(con, mode, my_file);Parameterscon − The FTP connectionmode − The new permissions.It consists of four numbers −The first number is always zeroThe second number specifies permissions for the OWNERThe third number specifies permissions for the OWNER's USER GROUPThe fourth number specifies permissions for EVERYBODY ELSEPossible values (to set multiple permissions, add up the following numbers) −1 = execute permissions2 = write permissions4 = read permissionsmy_file − The File nameReturnThe ftp_chmod() function returns new file permissions on success or FALSE on error.ExampleThe following is an example to set file permission by changing ... Read More

ftp_chdir() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

104 Views

The ftp_chdir() function changes the current directory on the FTP server.Syntaxftp_chdir(con, dir)Parameterscon − The FTP connectiondir − The directory to change toReturnThe ftp_chdir() function returns TRUE on success or FALSE on failure.ExampleThe following is an example wherein the current directory is changed −

ftp_cdup() function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

84 Views

The ftp_cdup() function changes the current directory to the parent directory.Syntaxftp_cdup(con);Parameterscon − The FTP connectionReturnThe ftp_cdup() function returns TRUE on success or FALSE on failure.ExampleThe following is an example wherein we are updating the current directory to parent directory −

ftp_alloc() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

85 Views

The ftp_alloc() function allocates space for a file to be uploaded to the FTP server.Syntaxftp_alloc(connection,size_of_file,res);Parametersconnection − The FTP connection to usesize_of_file − The number of bytes to allocateres − A variable to store the server responseReturnThe ftp_alloc() function returns TRUE on success or FALSE on failureExampleThe following is an example −

header() function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

336 Views

The header() function sends a raw HTTP header to a client.Syntaxheader(string,replace,resp_code)Parametersstring − The header string to send.replace − Indicates whether the header should replace previous or add a second header.resp_code − It forces the HTTP response code to the specified valueReturnThe header() function returns nothing.ExampleThe following is an example to save a generated PDF −

usleep() function in PHP

George John
Updated on 30-Dec-2019 07:01:37

37 Views

The usleep() function delays execution of the current script for few microseconds.Syntaxusleep(msec)Parametersmsec − The number of microseconds to delay the script.ReturnThe usleep() function returns nothing.Example Live DemoOutputThe following is the output.03:06:08 03:06:10 03:06:15

unpack() function in PHP

Chandu yadav
Updated on 30-Dec-2019 07:00:49

390 Views

The unpack() function unpacks data from a binary string.Syntaxunpack(format, data)Parametersformat − The format to use. Here are the possible valuesa −NUL-padded stringA − SPACE-padded stringh − Hex string, low nibble firstH − Hex string, high nibble firstc − signed charC −unsigned chars − signed short (always 16 bit, machine byte order)S − unsigned short (always 16 bit, machine byte order)n − unsigned short (always 16 bit, big endian byte order)v − unsigned short (always 16 bit, little endian byte order)i − signed integer (machine dependent size and byte order)I − unsigned integer (machine dependent size and byte order)l − signed ... Read More

uniqid() function in PHP

Arjun Thakur
Updated on 30-Dec-2019 06:59:26

233 Views

The uniqid() function generates a unique ID based on the current time in microseconds.Syntaxuniqid(prefix, more_entropy)Parametersprefix − The prefix to the unique ID.more_entropy − The more entropy at the end of the return value.ReturnThe uniqid() function returns unique identifiers as string.Example Live DemoOutputThe following is the output.5bfd5bd045faa

time_sleep_until() function in PHP

Ankith Reddy
Updated on 30-Jul-2019 22:30:23

84 Views

The time_sleep_until() function delays execution of the current script until the specified time. Syntax time_sleep_until(time) Parameters time − The time until execution will delay. Return The time_sleep_until() function returns true on success. Example The execution of the above script is now delayed for 15 seconds.

Advertisements