I have an array named 'users' in which I am storing some variables as you see below.I want to verify if the 'nume' (name) value already existing in this array is the same as the value introduced by a person in a search box. I've tried some methods but I haven't obtained the wanted result. I think it is something obvious I can't see at the moment.
EDIT : The image is the result of var_dump() of my code. I am using it for people to understand what I want to know.
CodePudding user response:
it's simple, try that:
$searchValue = 'victor';
$index = array_search($searchValue, array_column($users, 'nume'));