do not display children (1) of the seventh result

Currently I’m trying to set up a simple parser

[php]<?php

require_once ‘simple_html_dom.php’;
$url = “website.com”;

$data = file_get_html($url);

$search = $data->find(“div.box_rezult”);

if($data->innertext!="" and $search ){
foreach($search as $box_rezult){

    echo $box_rezult->find("td.lottery_name", 0)->plaintext;
    echo "<br/>";

    echo $box_rezult->find("td.lottery_text", 0)->plaintext;
    echo "<br/>";

    $table = $box_rezult->find("table.last-draw-table", 0);

    echo $table->children(2)->children(0)->plaintext;
    echo "<br/>";

	if (!isset( $table->children(2)->children(1)->plaintext )) {
    }
	else

    echo $table->children(2)->children(1)->plaintext;
    echo "<br/>";

}

}
$data->clear();
unset($data);
?>[/php]

The result is something like this

Name Date Numbers (additional number if exist)

Name
Date
Numbers
(additional number if exist)

and so on 9 times. But additional numbers must be represented in all parsed rows except the 7th. I don’t have enough php knowledge to accomplish that.

Thanks!

If you change to use a for loop then you will have an incrementing number for the iteration you’re in. Then you can just do

[php]if ($i != 7) {
// add stuff
}[/php]

thanks! but would you be so kind to show me how to make it?

Sponsor our Newsletter | Privacy Policy | Terms of Service