Month: April 2020

Linux alias command

The alias command assigns a command or set of commands to a string. Aliases are generally used to simply typing a long command or to execute an option to a…

is_dir not working

The is_dir() function in PHP allows users to check whether a file is a directory. It returns true if the file is a directory. However, the addresses provided must be…

PHP: Display directory contents

For security reasons, most servers on the Internet do not show the contents of a directory if the directory address is typed. The user is either redirected to index.whatever, a…

PHP: Encrypting and Decrypting

The crypt() function provide one-way encryption. Using one-way encryption is like using a key to lock and unlock something. The key is your password. To encrypt: To decrypt:

PHP: File functions

Opening directory and listing files See the following code: output: To remove certain file name from the list, see the following code: This code lists all files except the ones…

rsync command

rsync is a very useful alternative to rcp and scp. It tool lets you copy files and directories between a local host and a remote host. The main advantage of…

PHP: How to read command-line input

In PHP, all commandline parameter are passed to the $argv array. Following example shows how to use this array: $argv[1] and $argv[2] contain the passed parameters in the order they…