Hello all,
In the following code I have a nested while loop (the one in red) which is being ignored. Any ideas why?
<?php
$fp1 = fopen('input.xml', 'r'); /*this is the CMI file */
$fp2 = fopen('output.txt','w');
$ClassTableName = ' ';
$CharArr01 = array();
$RootFlag=0;
$count=0;
/*write XML file header */
while($count<4) {
$cmi_read = fgets($fp1, 999);
fwrite($fp2, $cmi_read);
$count = $count + 1;
}
while (!feof($fp1)) /*loop thru til end of file */
{
$cmi_read = fgets($fp1, 999);
if (strstr($cmi_read, '<class>'))
{
fwrite($fp2, $cmi_read);
[COLOR="Red"]While ($EndOfClass = 0)[/COLOR]
{
$cmi_read = fgets($fp1, 999);
fwrite($fp2, $cmi_read);
if (strstr($cmi_read, '</class>'))
{
$EndOfClass = 1;
}
}
}
$EndOfClass = 0;
}
fclose($fp1);
fclose($fp2);
?>
Thanks,
Craig
PHP v5.2.3 / Windoze / Using PHP from the Command Prompt