Detect WAP browser and redirect to different url in PHP

Do you want to have the same url for your Web and Wap broswer? The following is the code to do so in PHP: