Jump to content

Archived

This topic is now archived and is closed to further replies.

desithugg

unusual probelm

Recommended Posts

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

Share this post


Link to post
Share on other sites
Force both of your variables to lower case with strtolower() and then compare them.

Share this post


Link to post
Share on other sites
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]


Regards
Liam

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.