elis Posted September 29, 2006 Share Posted September 29, 2006 I have the following code:[code]if($userpenname==($_POST['recip'])) {$output.="........."[/code]Problem is the 'if' function is only being carried if the character cases match exactly, is there a method to get the function to disregard capitalization? Quote Link to comment https://forums.phpfreaks.com/topic/22550-code-to-disregard-captilization/ Share on other sites More sharing options...
Barand Posted September 29, 2006 Share Posted September 29, 2006 use strtolower() or strtoupper() to covert both to same capitalization.EDIT or use strcasecmp() Quote Link to comment https://forums.phpfreaks.com/topic/22550-code-to-disregard-captilization/#findComment-101193 Share on other sites More sharing options...
HuggieBear Posted September 29, 2006 Share Posted September 29, 2006 Make them both the same type...[code]<?phpif (strtolower($userpanname) == strtolower($_POST['recip'])){ // output here}?>[/code]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/22550-code-to-disregard-captilization/#findComment-101194 Share on other sites More sharing options...
elis Posted September 30, 2006 Author Share Posted September 30, 2006 Ah, thank you. This worked out quite well. Quote Link to comment https://forums.phpfreaks.com/topic/22550-code-to-disregard-captilization/#findComment-101202 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.