How to achieve subdomain type domain names with php
<p>I am developing a site where users will have permalinks for them like <strong>user.domain.com</strong> or <strong>domain.com/user</strong> and i want to achieve this by php code. foe ex.
for username <strong>stack</strong> the permalink is <em>stack</em> and on going to <strong>stack.domain.com</strong> or <strong>domain.com/stack</strong> it should go to profile page of user!</p>
