Monthly Archives: August 2010

How many site does his site receive?

Maybe that’s the question you ask on your competitor’s website? Basically it’s hard to know unless the website’s owner tell you, display the stats on their website or you can get into their system.

But with this tool at least you can estimate how many visitors they receive in a day. I’ve tried with few sites of mine and it come quite close to the real stats.

http://www.sitereport.org/p/domainnamehere.com

Have it a try!

Add xx month or xx day to a date

To add xx day or xx month to a date using this method.

1
2
3
4
5
6
7
8
9
10
11
12
$mktime = explode("-",$rs_loan['datestart']);
 
$x = 5;
 
//to add $x to day
$newdate = date("Y-m-d",mktime(0,0,0,$mktime[1],$mktime[2]+$x,$mktime[0]));
 
//to add $x to month
$newdate = date("Y-m-d",mktime(0,0,0,$mktime[1]+$x,$mktime[2],$mktime[0]));
 
//to add $x to year
$newdate = date("Y-m-d",mktime(0,0,0,$mktime[1],$mktime[2],$mktime[0]+$x));

Append 0’s in front of a running number

Sometimes we need to fix a number to say 5 digits. e.g. 00012. Here’s the code to append the 0’s in front of the numbers so that you can just save the number without 0’s in front in your database.

1
2
$anum = 123;
echo str_pad($anum, 5, '0', STR_PAD_LEFT);

Result will be displayed as 00123