desithugg Posted August 11, 2006 Share Posted August 11, 2006 okay the problem is sometimes i use the same type of query but it gets the username with a different spelling meaning sometimes all capital sometimes not.So when i check stuff like[code]<?if ($owner != "$me"){echo "You do not own this item.";exit;}?>[/code]even when the username is same it ives that error is there anyway i can make it non case sensitive Link to comment https://forums.phpfreaks.com/topic/17255-unusual-probelm/ Share on other sites More sharing options...
zq29 Posted August 11, 2006 Share Posted August 11, 2006 Force both of your variables to lower case with strtolower() and then compare them. Link to comment https://forums.phpfreaks.com/topic/17255-unusual-probelm/#findComment-73142 Share on other sites More sharing options...
shocker-z Posted August 11, 2006 Share Posted August 11, 2006 it should be[code]<?if ($owner !== "$me"){echo "You do not own this item.";exit;}?>[/code]But if you want to do both as uncase sencitive you could use strlower ot strupper to make both variables either upper or lower[code]<?if (strtolower($owner) !== strtolower($me)){echo "You do not own this item.";exit;}?>[/code]RegardsLiam Link to comment https://forums.phpfreaks.com/topic/17255-unusual-probelm/#findComment-73145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.