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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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.