Here's the basic code I'm using.
$browser = getenv("HTTP_USER_AGENT");
if (eregi('iPhone', $browser)) {
...
}
Where there are ellipses (...) you do whatever you want -- the most likely best use being point to an iPhone-friendly stylesheet. Then the question is, what IS an iPhone-friendly stylesheet? Digging a little deeper, what will iPhone users respond best to?