Case Insensitive

How do I make something case insensitive?
Say, if

$variable1 = "Hello";
$variable2 = "HELLO";

How can I tell if variable1 and variable 2 are the same, even though one is totally capitalized, and the other isn't?

Thanks,
Mark
LVL 1
eversoslightlyAsked:
Who is Participating?
 
martinagCommented:
if (lc($variable1) eq lc($variable2)) {
  # I don't know is the "correct" way of doing it, but it works...
}

Martin
0
 
martinagCommented:
if (lc($variable1) eq lc($variable2)) {
  # I don't know is the "correct" way of doing it, but it works...
}

Martin
0
 
eversoslightlyAuthor Commented:
Thanks!  Works great - just answer the question, and I'll give ya the points.
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.