限制输出的XML记录

I was wondering if there is a way to set a limit to the XML results that are showed?

Like in php/mysql: SELECT * FROM blablabla ORDER BY RAND() LIMIT 0,44

But then for stopping the XML Parse after 10 records..

Thnx!

You'll need some sort of counter. If you want to leave things in a foreach loop:

$i = 0;
foreach($xml as $xmls) {
    // do stuff here

    $i++;
    if($i == 10)
        break;
}

or if you want to use a for loop:

for ($i = 0; $i < 10; $i++) {
    $xmls = $xml[$i];
    // do stuff here
}