I want to check if an element is not in the array and then want to redirect the page: My code is as below:
$id = $access_data['Privilege']['id'];
$this->Session->setFlash(__('Access Denied! You are not eligible to access this.'), 'flash_custom_success');
How to determine whether an element is in an array baffles me? We may use PHP's in array function to determine whether an element is present in an array. I tried using (!in array) to check it, but I did not get a result.