Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-12-2009, 08:39 AM   #1
Emil
Confirmed User
 
Emil's Avatar
 
Join Date: Feb 2007
Location: Sweden
Posts: 5,650
PHP Help Needed (easy q for programmers)

I want to compare 2 strings but it shouldn't matter if the strings are uppercase or lowercase. Can anyone show me what the code would look like?
__________________
Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.)
(Signup with ONLY your Email and Password. You can also refer people and get even more.)
Emil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-12-2009, 08:50 AM   #2
tnaindex
Registered User
 
Join Date: Oct 2008
Posts: 26
if (strtolower($string1)==strtolower($string2))
{
Thank_me();
}
tnaindex is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-12-2009, 08:51 AM   #3
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
http://us.php.net/manual/en/function.strcasecmp.php
__________________
I like pie.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-12-2009, 10:12 AM   #4
Emil
Confirmed User
 
Emil's Avatar
 
Join Date: Feb 2007
Location: Sweden
Posts: 5,650
Thanks!!
__________________
Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.)
(Signup with ONLY your Email and Password. You can also refer people and get even more.)
Emil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-12-2009, 10:24 AM   #5
polle54
Confirmed User
 
Join Date: Jul 2004
Location: The Beach
Posts: 4,626
Quote:
Originally Posted by tnaindex View Post
if (strtolower($string1)==strtolower($string2))
{
Thank_me();
}
That's one way to do it, but there's a string function for it, so if it's a operation that has to repeated many times I think there's less overhead in using:

Dispite of what you might think is indicated by the name, this function is case insencitive

Code:
if(strcasecmp($string1,$string2) == 0)
{
   Thank_me_more();
}
Returns:
* 0 - if the two strings are equal
* <0 - if string1 is less than string2
* >0 - if string1 is greater than string2
__________________
ICQ# 143561781
polle54 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.