arrays - Return of a if using empty() function in PHP -
i have following if in code check if array empty,
if (!empty($data['id']) && (empty($data['student_no']) || empty($data['batch']) ) ) { print_r("inside if "); }
$data['id']
,$data['student_no']
,$data['batch']
arrays.
array values below,
1.$data['id']
-> array ( [0] => 1 [1] => [2] => )
2.$data['student_no']
-> array ( [0] => [1] => [2] => )
3.$data['batch']
-> array ( [0] => )
but not got inside if , print "inside if" string.
please tell me wrong ?
you forgot ! in if
!empty($data['student_no']
Comments
Post a Comment