Archive for the ‘Code’ tag

Year PHP Code

Written by Shaibanii Pressed on December 2nd, 2008 - 9:18 pm Filled Under: Randomness

If you wanna use the current year for a copyright statement or whatever and not have to update it every year (if you’re that lazy :P) Here’s how:

If you’re in a WordPress environment:

<?php the_time('Y'); ?>

Output: 2008
(Yes, I can execute PHP in my posts.)

And in any normal .php page, you can get the year from your server.

<?php echo date('Y'); ?>

Output: 2008
So on exactly 31/12/2008 11:59, it’ll be 2008, and the next minute, well.. you know what’s gonna happen. :-)


Iframes Out, PHP In

Written by Shaibanii Pressed on August 30th, 2008 - 12:05 pm Filled Under: Tutorials

Rate: This sucks!Could be betterDecentVery GoodPerfect!

Loading ... Loading ...
Yes, you heard me, Iframes out. Yes a site can work without them. Calm down :-| Why would you wanna get rid of Iframes?
1. They’re old
2. Too “limiting”
3. Its harder to get on Google etc. with them.
4. They’re un-professional IMO.

So we’re gonna get rid of them using PHP :-D
Note: Remember to save all your files that use this method with the .php extension.
Read the rest »