how to compare case insensitive two strings in php

前端 未结 2 647
粉色の甜心
粉色の甜心 2021-01-26 16:19

I need to compare two string case insensitive here is my code

if(strcasecmp($genderseek,\"both\")==0)
{
  $gender2=\"$Ugender==\'MALE\'||$Ugender==\'FEMALE\'\";
         


        
2条回答
  •  礼貌的吻别
    2021-01-26 16:36

    You would need to use PHP strtolower() function to compare everything at lower case. This way, case sensitivity will be eliminated.

提交回复
热议问题