Answer the question
In order to leave comments, you need to log in
Why doesn't the program exit the cycle after parsing xml after the output function?
$result = simplexml_load_file("date.xml");
$i=0;
$mark = array(":", " ", ".");
$max=0;
while ($result){
$str=$result->str->item[$i]->attributes()->March;
if ($str == '45'){
$timeNotFormatted=$result->str->item[$i]->attributes()->TimeNav;
$time = str_replace($mark, "", $timeNotFormatted);
$num = ltrim($time, '0');
$intnum= (int)$num;
if ($intnum>$max){
$max=$num;
}
}
$i++;
}
echo $max;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question