Want to show “mobile” or “phone” site version — check user agent
So, you (i, we) want to show to our site phone visitor “mobile” (intended for phone users) version of the site. First of all we must detect “mobile” request. To do this we must check user agent header from request.