You want to send mobile or tablet browsers to an … Redirecting Mobile Browsers to a Mobile Optimized Site in PHP
You want to start generating output before you’re finished sending … Buffering Output to the Browser in PHP