I've researched and tried a number of things but can't figure this one out. When this if statement receives 'gallery' from the url I don't want it to be case sensitive. Currently a person would have to type the name exactly as I have it below in order for the correct image to show.

I've tried playing around with the i modifier but it's not coming together. Any help would be great. Thanks.

if($_GET['gallery']=="arte x arte")
{
   $userImage = "arte_x_arte.jpg";
}

    Would something like this work, or is this too simplistic?

    <?php
    $input   = "Arte x ArTe";
    $string  = "arte_x_arte";
    $compare = strtolower(str_replace(" ", "_", $input));
    
    print "Input: $input<br/>";
    print "String: $string<br/>";
    print "Compare: $compare<br/><br/>";
    
    if (strcmp($string, $compare) == 0) {
      print 'We are the same!';
    }
    else {
      print 'We are different!';
    }
    

      gallery coming from the url is likely to be from a form, you shouldn't have he user typing it, then you have control as to the case of the the var.

        Write a Reply...