Then i trying to use this code after first replacement loop is stoping $Autos->length = 10
$Autos = $dom->getElementsByTagName('cars'); // Find Sections
$NewElement = $dom->createElement('hello','hi');
for ($i = 0; $i < $Autos->length; $i++)
{
$Autos->item($i)->parentNode->replaceChild($NewElement, $Autos->item($i));
echo $Autos->length . " i= " .$i;
}
so $i always = 0 why this hapens?
No comments:
Post a Comment