I have an associative array where i put DomElements. I want just recovers a cell from a table so i loop the rows($materie) and i try to extract for each the 9 column cell. The problem is that the result of the $cell[$o][9]->nodeValue ( that i put on $DTO['materie'][$o]['prenotato']) is the same for each turn of the loop: it take the value of the first element and keep the same.
for($o = 0; $o < sizeof($materie); $o++) {
$DTO['materie'][$o] = $materie[$o+1];
/**ROWS */
$cell = array();
$cell[$o] = $parserCommons->findElementsByTag($table[0], 'td');
$DTO['materie'][$o]['prenotato'] = $cell[$o][9]->nodeValue;
}
return $DTO;
this is the function body:
public function findElementsByTag($DOMArray, $tagName)
{
$output = $DOMArray->getElementsByTagname($tagName);
return $output;
}