mercredi 24 juin 2015

Why my IF condition is getting skipped?

I have a problem. After every loop my first IF condition is getting skipped.

http://ift.tt/1FB3lXg

Code should increase DATE +1 IF i find first number 0 And second number less than 5. After first skipped line everything works.. Date is increased from number 24 To 25.

My current php code:

if ((@end($cellData[$i][$key]) !== null) AND (@end($cellData[$i][$m]) !== null)) {

    if(($time == '0') AND ($time2 < '5')) {

        $program_timeC1 = '  <programme start="' . date("Y") . $data . $laikas . '00 +0600"';
        $program_timeC1 .= ' stop="' . date("Y") . ($data+1);
        $program_timeC3 = $program_timeC1 . $cellData[$i][$m]['laikas'] . '00 +0600"' . ' channel="' . $info[0]['id'] . '">' . PHP_EOL;
                $opa = $program_timeC3;

        } else {

            $program_timeC2 = '  <programme start="' . date("Y") . $data . $laikas . '00 +0600"';
            $program_timeC2 .= ' stop="' . date("Y") . $data;
            $program_timeC4 = $program_timeC2 . $cellData[$i][$m]['laikas'] . '00 +0600"' . ' channel="' . $info[0]['id'] . '">' . PHP_EOL;
            $opa = $program_timeC4;
        }
        file_put_contents($new_xml, $opa, FILE_APPEND);

    }

Aucun commentaire:

Enregistrer un commentaire