首先,你们大家的季节感和幸福的新年! time!
The following code is a solution that returns the labels and values in a formatted array ready for input to mysql. Very nice;-)
<?php
$dom = new DOMDocument();
@$dom->loadHTMLFile( http://schulen.bildung-rp.de/gehezu/startseite/einzelanzeige.html?tx_wfqbe_pi1%5buid%5d=60119 );
$divElement = $dom->getElementById( wfqbeResults );
$innerHTML= ;
$children = $divElement->childNodes;
foreach ($children as $child) {
$innerHTML = $child->ownerDocument->saveXML( $child );
$doc = new DOMDocument();
$doc->loadHTML($innerHTML);
//$divElementNew = $dom->getElementsByTagName( td );
$divElementNew = $dom->getElementsByTagname( td );
/*** the array to return ***/
$out = array();
foreach ($divElementNew as $item)
{
/*** add node value to the out array ***/
$out[] = $item->nodeValue;
}
echo <pre> ;
print_r($out);
echo </pre> ;
}
?>
这一法典的范围非常细微,它开展一项行动,即打算多次呼吁。 因此,在职能中加以总结是有道理的。 无论我们想要什么东西,我们都可以把它称作“多载”。 我试图用以下法典来做到这一点,但这并不适用。 我仍然无法确定在哪里把所建的——内部或之外——放在职能之内。
<?php
function multiload ($uid) {
/*...*/
// $uid = 60119 ;
$dom = new DOMDocument();
$dom->loadHTMLFile( basic-url . $uid);
}
multiload ( 60089 );
multiload ( 60152 );
multiload ( 60242 );
/*...*/
$divElement = $dom->getElementById( wfqbeResults );
$innerHTML= ;
$children = $divElement->childNodes;
foreach ($children as $child) {
$innerHTML = $child->ownerDocument->saveXML( $child );
$doc = new DOMDocument();
$doc->loadHTML($innerHTML);
//$divElementNew = $dom->getElementsByTagName( td );
$divElementNew = $dom->getElementsByTagname( td );
/*** the array to return ***/
$out = array();
foreach ($divElementNew as $item)
{
/*** add node value to the out array ***/
$out[] = $item->nodeValue;
}
echo <pre> ;
print_r($out);
echo </pre> ;
}?>
说明
multicall( 60089 );
multicall( 60152 );
multicall( 60242 );
/*...*/
This is still repetitive, so we can put the numbers in an array - can ´t we! Then we can loop through the array.
$numbers = array ( 60089 , 60152 , 60242 /*...*/);
foreach ($numbers as $number) {
doStuff($number);
}
But the question is - how to and where to put the loop!?
任何人都可以给我一个起点。
BTW - if i have to be more descriptive i am trying to explain more - just let me know... it is no problem to explain more
greetings Zero
www.un.org/Depts/DGACM/index_spanish.htm UPDATE: thaks to the grand help i now have made a grand step
<?php
function multiload ($uid) {
/*...*/
// $uid = 60119 ;
$dom = new DOMDocument();
$dom->loadHTMLFile( basic-url . $uid);
}
multiload ( 60089 );
multiload ( 60152 );
multiload ( 60242 );
/*...*/
$divElement = $dom->getElementById( wfqbeResults );
$innerHTML= ;
$children = $divElement->childNodes;
foreach ($children as $child) {
$innerHTML = $child->ownerDocument->saveXML( $child );
$doc = new DOMDocument();
$doc->loadHTML($innerHTML);
//$divElementNew = $dom->getElementsByTagName( td );
$divElementNew = $dom->getElementsByTagname( td );
/*** the array to return ***/
$out = array();
foreach ($divElementNew as $item)
{
/*** add node value to the out array ***/
$out[] = $item->nodeValue;
}
echo <pre> ;
print_r($out);
echo </pre> ;
}
$numbers = array ( 60089 , 60152 , 60242 /*...*/);
foreach ($numbers as $number) {
multiload($number);
}
?>
i add the code a the end.... Now i have learned alot. By the way: I am very happy to be here!!! Greetings zero Now i try it out...