[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

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

0
XK8ER
Asked:
XK8ER
1 Solution
 
Roger BaklundCommented:
Try this:


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

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now