如果语句变量返回空(If statement variable returning empty)
这是我编写的测试代码,用于获取$ rectype的值集以插入表中。 我遇到的问题是$ rectype返回0或空。 文件确实存在,因为我执行类似的is_file检查以启动导致编码的这一部分的过程
$dirchk1 = "/temp/files/" . $data[0] . ".doc"; // exist $dirchk2 = "/temp/files/" . $data[1] . ".doc"; // exist $file_1 = (is_file($dirchk1)); $file_2 = (is_file($dirchk2)); if ($file_1) { $rectype == ($file_2 ? '3' : '1'); } echo $rectype . "\n";this is a test code i wrote to get a value set for $rectype to insert into a table. problem I'm having is $rectype is returning 0 or empty. the files do exist since I perform a similar is_file check to start the process that leads up to this section of the coding
$dirchk1 = "/temp/files/" . $data[0] . ".doc"; // exist $dirchk2 = "/temp/files/" . $data[1] . ".doc"; // exist $file_1 = (is_file($dirchk1)); $file_2 = (is_file($dirchk2)); if ($file_1) { $rectype == ($file_2 ? '3' : '1'); } echo $rectype . "\n";最满意答案
您正在使用==而不是= 。
You are using == instead of =.
更多推荐
发布评论