Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Checks if $numer['image'] exists, and if it doesn't exist, sets it to "-1"
If $numer['image']
undefined, the method searches for the specified string, before setting the value$numer['image'] = '-1';
Here is a link from the site tdme.ru/product/nizvolobor/380/#
Present in the table either Photo or Image. It turns out that if there is no tag with the name, then the code will not be executed. But it is being fulfilled.
$table_of_goods = $html_sub->find('div#modal_table table.mod_t')[0]->children;
$table_header = $table_of_goods[0]->find('tr')[0];
$table_body = $table_of_goods[1]->children;
$number = array();
// Pull out the cell numbers with the columns we need
foreach (($table_header->children) as $num => $th_row) {
// echo "FIRST foreach
";
//var_dump($th_row->plaintext);
//var_dump($num);
switch(trim($th_row->plaintext)){
case 'Name':
case 'Light name':
$numer["name"] = $num;
break;
case 'Photo':
case 'Image':
$numer['image'] = $num;
break;
case 'Article':
$numer['model'] = $num;
break;
}
}
if (!(isset($numer['image']))){
$numer['image'] = '-1';
}
//echo "";
$rowspan = 1;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question