This tutorial provide a script to detect mobile browser and according to that create your moble version website , Then use this script to redirect to own moble version site.
You can put the php code at the top of your website page. If a user is coming from a mobile device the out put of the function will be “yes”. else if the user is coming from computer the out put of the function will be “no”. If the output of the function is yes you can understand that user is coming from a mobile device, so you can write a redirection to mobile site code after verifying the output of the function.
Method - 1:
checking using stripos functionality.
Method - 2:
checking using preg_match functonality.