RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]
If you want to add the www to URLs check this out.
Natural Born Programmer
This functin will help to convert the Linux/Unix timestamp to human readable format:
<?php
function unix_timestamp_to_human ($timestamp = "", $format = 'D d M Y - H:i:s')
{
if (empty($timestamp) || ! is_numeric($timestamp)) $timestamp = time();
return ($timestamp) ? date($format, $timestamp) : date($format, $timestamp);
}
$unix_time = "1251208071";
echo unix_timestamp_to_human($unix_time); //Return: Tue 25 Aug 2009 - 14:47:51
?>
I had to cleanup a HTML created out of MS Word Document manually. Honestly it is a pain to manually search and replace all the junks Word Document generating. So I have written a text conversion function in PHP to automatically cleanup the MS Word junks and output HTML entities.
Here's a simple function to generate a random string based on Alpha, Numeric, Nozero, MD5 and SHA1 types.