我正在从 xml 中获取数据,它有 100 个元素,我的代码:
foreach($sections->children() as $question){
$xml_data .= 'Section Name: '.$question->section_name.'<br/>';
$xml_data .= 'Question No.: '.$question->qno.'<br/>';
if($question->answer == null || $question->answer == ''){
$question->answer = 'Not attempted';
$xml_data .= 'Answer: '.$question->answer.'<br/>';
} else {
$xml_data .= 'Answer: '.$question->answer.'<br/>';
}
$xml_data .= 'Time: '.$question->time.'<br/>';
if($question->seen == '1'){
$xml_data .= 'Seen<br/>';
} else {
$xml_data .= 'Not Seen<br/>';
}
if($question->flag == '1'){
$xml_data .= 'Flaged<br/>';
} else {
$xml_data .= 'Not Flaged<br/>';
}
}
从上面我得到 100 个问题,但我从上面只显示 25 个问题,我该怎么做?