我从 MySql 数据库中获取一组数据:
Array (
[0] => Array ( [upload_status] => 0 )
[1] => Array ( [upload_status] => 0 )
[2] => Array ( [upload_status] => 0 )
[3] => Array ( [upload_status] => 0 )
[4] => Array ( [upload_status] => 0 )
[5] => Array ( [upload_status] => 0 )
[6] => Array ( [upload_status] => 0 )
[7] => Array ( [upload_status] => 1 )
[8] => Array ( [upload_status] => 0 )
[9] => Array ( [upload_status] => 0 )
[10] => Array ( [upload_status] => 0 )
[11] => Array ( [upload_status] => 1 )
[12] => Array ( [upload_status] => 1 )
[13] => Array ( [upload_status] => 1 )
)
我想检查0
数组中是否存在。
我正在使用此代码,但 in_array() 返回 false,尽管我可以在上面的数组中看到零。
$query = $this
->db
->select('upload_status')
->where('lab_ref_no',$labref)
->get('sample_issuance')
->result_array();
print_r($query);
if (in_array('1', $query)) {
echo 'true';
} else {
echo'false';
}