IT Knowledge Base

/IT Knowledge Base

How to add days, weeks, months to any date in PHP?

You may want to add dates to a specific date by using PHP codes. The following codes show how to add days, weeks and months to a date variable. Units can be used: day, days, week, weeks, month, months, year, years […]

By | May 7th, 2014|IT Knowledge Base|0 Comments

Enable and Disable FTP in Mac OS X Lion

You may want to set your Mac OS devices as a FTP server. Or you may want to upload files to your Mac OS devices through FTP. But how to enable and disable the FTP in your Mac OS X Lion? It is very easy that only a few steps are required. […]

By | May 7th, 2014|IT Knowledge Base|0 Comments

Setup a new CentOS (Apache, PHP, MySQL, phpMyAdmin, Sendmail)

After the installation of a new CentOS platform, you can follow the steps in this article to setup some important configurations and install some important services. e.g. resetting the root password, set the server local time, install apache, mysql, php, php-mysql, sendmail services and so on. […]

By | May 7th, 2014|IT Knowledge Base|0 Comments

Find files by Days or Time in Linux

How to use the linux command to find the files by the modified dates or created dates or accessed date? Three types of dates can be used for command `find`: modified dates, access dates and created dates. You can specify the units as below: s — second m — minute h — hour d — day w — week […]

By | May 7th, 2014|IT Knowledge Base|0 Comments

Find the current path in Linux (pwd)

PWD To find the full current path in Linux, you can just use the command pwd: [sourcecode][root@myserver ~]# pwd[/sourcecode]

By | May 7th, 2014|IT Knowledge Base|0 Comments

Move a MySQL Database to New Linux Server

I have received a request to move a mysql database from the current database to a new server. The easiest way is to use phpMyAdmin to export the database. Or we can simply use the command mysqldump. Howerver, I do not have phpMyAdmin access. And I get the following error when using the command "mysqldump". mysqldump: Got [...]

By | May 7th, 2014|IT Knowledge Base|0 Comments

MySQL Command to Create new user and database

If you have installed phpMyAdmin in your server, you can easily use the function to create new user and database by checking the checkbox "Create database with same name and grant all privileges". It will set the username of the new user as the same as the database name. But your server may be hacked through phpMyAdmin if [...]

By | May 7th, 2014|IT Knowledge Base|0 Comments

PHP Replace Some Characters

Some personal information would like to be confirmed by users or customers by displaying a part of the details. For example, visa card number, ID card number, email, phone number, etc. Sometimes only a few characters would be shown and other characters would be replaced by *. The followings are two examples to replace some [...]

By | May 7th, 2014|IT Knowledge Base|0 Comments

Format of Numbers in PHP

To set the format of numbers in PHP, you can use the function number_format. You can set the pattern, separator of the decimal point and separator of thousands by using this function. $number = 12345.67; // The default pattern echo number_format($number) . "<br>"; // Output: 12,346 // Set the number of decimals echo number_format($number,4) . "<br>"; [...]

By | May 7th, 2014|IT Knowledge Base|0 Comments