I've been working on a mobile version of this website, much of it was remakably simple.
Step One Wheat from Chaff.
Step Two Rewriting.
all the re-rwites in this section and
the size does matter section assume
ou've a var called "$html" which it updates
This page is pretty symplistic, its just got a couple of images. In it. All my site like most blogs is a MySQL database full of chunks of HTML. Problem all the paths to photos etc need re- writing for the actuall posts. Really sumple use preg_replace to solve it. All my ilustrations etc are in a directory called "content" so the paths are allways content/something. Just replace contentslash with slashcontentslash.
$html=preg_replace("/content\//i", "/content/", $html); //rewrite paths
I've also go various bits of flash and video's embeded in my HTML posts. Hmm don't really want them in a mobile browser, this is a bit harder, strip_tags() the pattern matching was behind me so I "borrowed" the following code from the commnets section of the PHP srip_tags() manual page: