Virtual subdomains

With the ever dynamic web world and to turn the web from a passive to an active entity , webmasters are fascinated with the idea of having subdomains for users like http://user.domain.ext.  Looks quite neat and tricky.
Yes that can be done easily, just by some configurations in your website cPanel. The steps are:
A. Login to cPanel
2. Then go to subdomains(… Dont worry u need not add subdomains for all of them individually :) )
3. Now just create a subdomain with name * that is:  *.yourDomain.ext and specify a root directory for it.
4. That is all.. Its done..

Now how to get the subdomain.. right?

1. Create a file called index.php in the *.yourDomain.ext root.
2. Add the following lines in the file:

<?php
$exp = explode(”.”, $_SERVER['HTTP_HOST']) ;
$username = $exp[0];
echo “Subdomain called: “. $username;
?>

Now just call any arbitary subdomain.. and see what happens :)