I have one Array which contain two elements, i am taking input from the user from the API request parameters sometimes it contains capital and small letters ,based on that i am writing some conditions ,Now what my requirement is if user enters small letters also it should match the given array please help me to fix the issue..
$array=['Admin','Root'];
if(in_array($request->role,$array)){
if($request->role== 'Admin'){
//my logic
}
}
URL-1:-
in this scenario it passes the condition
/v1/Users?role=Admin
URL-2:- /v1/Users?role=admin
this scenario fails , i need to pass this scenario also