Page 1 of 1

comparing a String ignoring its case

Posted: Tue Jun 30, 2009 5:18 am
by sfoley77
I need to write the equilvilant of this statement in php and ignore its case but I cant find a operator in php for it here is the java version:

Code: Select all

customer.getZzaux_contact_by_email().equalsIgnoreCase("Y"))
can anyone show me the way to do this
Thanks
Sean

Re: comparing a String ignoring its case

Posted: Tue Jun 30, 2009 5:27 am
by prometheuzz
Try:

Code: Select all

echo strcasecmp("SfolEY77", "sfoley77");

Re: comparing a String ignoring its case

Posted: Tue Jun 30, 2009 5:32 am
by BornForCode
prometheuzz means:

Code: Select all

 
if(!strcasecmp('nici','Nici')) {
    echo 'jackpot are equals';
}
else
{
    echo 'Bleah';
}