Task: Check if value exists in a multidimensional array or not\
Example array
Array ( 's_id' => '100', 's_name' => 'Peter', 'f_fee' => '1000' ), '1' => Array ( 's_id' => '101', 's_name' => 'Peter', 'f_fee' => '1000' ), '2' => Array ( 's_id' => '102', 's_name' => 'Peter', 'f_fee' => '1000' ), ); ?>
Check the below code to check the value present in an array or not.
if(array_search(100, array_column($student_data, 's_id')) !== False) { echo "Value exist"; } else { echo "Value not exist"; }0 0
Please Login to Post the answer