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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -