Probleme condition If ($var!="")
Bonjour,
J'ai un petit souci de condition sur un if:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
// ExcelFile($filename, $encoding);
$data = new Spreadsheet_Excel_Reader();
// Set output Encoding.
$data->setOutputEncoding("CP1251");
$data->read("$chemin/$fichier");
for ($i = 11; $i <= 50; $i++) {
$codeArt = $data->sheets[0]['cells'][$i][1];
$desArt = $data->sheets[0]['cells'][$i][3];
$qtePiece = $data->sheets[0]['cells'][$i][4];
$unite = $data->sheets[0]['cells'][$i][5];
$speClause = $data->sheets[0]['cells'][$i][6];
$docRecept = $data->sheets[0]['cells'][$i][7];
$criticite = $data->sheets[0]['cells'][$i][8];
$pamp = $data->sheets[0]['cells'][$i][9];
$codeFour = $data->sheets[0]['cells'][$i][10];
$four = $data->sheets[0]['cells'][$i][11];
if (($codeArt!="")&&($desArt!="")&&($qtePiece!="")&&($unite!="")&&($speClause!="")&&($docRecept!="")&&($criticite!="")&&($pamp!="")&&($codeFour!="")&&($four!="")){
echo "OK";
}
} |
Le souci c'est que il ne met pas OK, alors qu'il devrait le mettre. J'ai fais le test suivant :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
// ExcelFile($filename, $encoding);
$data = new Spreadsheet_Excel_Reader();
// Set output Encoding.
$data->setOutputEncoding("CP1251");
$data->read("$chemin/$fichier");
for ($i = 11; $i <= 50; $i++) {
$codeArt = $data->sheets[0]['cells'][$i][1];
$desArt = $data->sheets[0]['cells'][$i][3];
$qtePiece = $data->sheets[0]['cells'][$i][4];
$unite = $data->sheets[0]['cells'][$i][5];
$speClause = $data->sheets[0]['cells'][$i][6];
$docRecept = $data->sheets[0]['cells'][$i][7];
$criticite = $data->sheets[0]['cells'][$i][8];
$pamp = $data->sheets[0]['cells'][$i][9];
$codeFour = $data->sheets[0]['cells'][$i][10];
$four = $data->sheets[0]['cells'][$i][11];
if (($codeArt=="")&&($desArt=="")&&($qtePiece=="")&&($unite=="")&&($speClause=="")&&($docRecept=="")&&($criticite=="")&&($pamp=="")&&($codeFour=="")&&($four=="")){
}else{
echo "OK";
}
} |
Ceci fonctionne, alors j'en ai deduis que cela venait de != mais la je ne comprend pas pourquoi ca ne fonctionne pas.
Pouvez-vous m'aider?
Merci d'avance.