例1
代码如下 | 复制代码 |
//Store your html into $html variable. $html=" Example Yahoo "; $dom = new DOMDocument(); //Evaluate Anchor tag in HTML for ($i = 0; $i < $hrefs->length; $i++) { //remove and set target attribute $newURL=$url.".au"; //remove and set href attribute // save html echo $html; ?> |
例2
代码如下 | 复制代码 |
/* <学生 number="10"2"> $itemsNodeList = $xmldoc->getElementsbyTagName('学生'); //封装成函数 $data = getNodeVal($xmldoc, '学生', $nodeArr); |