Mktimephp
There are a lot of things you can do with the mktime function in php. The result of the code displayed above is one of them. So, now if you look below you will see how the php mktime code is produced. Used to make a php countdown of the date of your choice. It is also referred to as php mktime, it really don't matter it will do the same thing! But anyway just look at the code and see what you can do with it!
<?php
$target = mktime(0,0,0,02,20,2012);
$today = time()+1;
$difference =($target-$today);
$days = (int)($difference/86400);
$event ="President's Day go find a sale!";
if ($days > 0){
echo "President's Day is in $days days!";
}
else{
echo "$event";
}
?>
This is the mktime function that starts off the code. Of course you will start and end with your php tags.
Here is the best resource for learning php start here
We are in week 20 of 2012 with 32 weeks left until 2013
The code above is pretty cool, it tells what week it is and how many weeks left until 2013. Another great way to use the php mktime function!
Variables
What are they? Well, variables are the work horse of php. So what is a variable, and how do they work? Variables stores a value and always starts with a $ sign. An example would be "Whasss UP" or "Hello World"! It would look like this ....
Whasss UP! - Hello World!
<?php
$name1 ="Whasss UP";
$name2 = "Hello World!";
echo "$name1 name2";
?>
This is just a small example, but you get the ideal! Now go and experiment, and see what you can come up with!
$_SERVER php
Your ip: 38.107.179.231
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
Have you ever wondered how people get your IP address or how they can tell you what browser your using? Well your in luck.... you can do all that with php.
You see, the php code will give you your ip address. Now that was easy don't you think?
Browser php
CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
<?php
echo $SERVER['HTTP_USER_AGENT'];
?>
Now the above code gives you what browser you are using.. Pretty cool way to use php!



