ignore case

hello there,
I have this code here to look for words from an array but I would like to ignore the case..
right now the array contains this

Apps
Movies
Games
eBooks

so all the links from the website are coming with lower case and im able to get the first 3
but ebooks its not showing because of the second capital letter..
.
 
 
if(isset($type) && (in_array(strtolower($type),$allowed_types) || in_array($type,$allowed_types) || in_array(ucfirst($type),$allowed_types) || in_array(strtoupper($type),$allowed_types))) {
 
 
 
.

Open in new window

LVL 1
XK8ERAsked:
Who is Participating?
 
Roger BaklundCommented:
Try this:


if(isset($type) && in_array(strtolower($type),array_map('strtolower',$allowed_types))) {

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.