This article mainly introduces php's method of converting html into wml WAP markup language. The example shows how php converts and filters tags, which is of great practical value, for more information, see
This article mainly introduces php's method of converting html into wml WAP markup language. The example shows how php converts and filters tags, which is of great practical value, for more information, see
This example describes how php converts html into a wml WAP markup language. Share it with you for your reference. The specific implementation method is as follows:
<? Php // tags // Html tag WAP language // -------------------------------------------- function html2wml ($ content) {// retain the image preg_match_all ("/] *)>/isU", $ content, $ imgarr); if (isset ($ imgarr [0]) & count ($ imgarr [0])> 0) {foreach ($ imgarr [0] as $ k => $ v) $ content = str_replace ($ v, "WAP-IMG ::{$ k}", $ content );} // filter out the style sheet and script $ content = preg_replace ("/