Re: string comparison

From: Date: Fri, 23 Aug 2002 13:10:45 +0000
Subject: Re: string comparison
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-113756@lists.php.net to get a copy of this message
"Support @ Fourthrealm.Com" <support@fourthrealm.com> wrote in message news:5.1.0.14.2.20020823091004.09ebe940@mail.bighost.ca... > > Would both of these generate the same result? > > Is there an advantage of one over the other? > > 1) if (strcmp($section, 'logout')) > > 2) if ($section == 'logout')) > > > Peter > > They do achieve the same goal... I'd say the later would be more advantageous coz you are simply using a logic statement hence in terms of the time factor it should be quicker... Where as in the first one we are making a call to a function hence there ought to be a couple of steps that are executed algorithmically... Spike > - - - - - - - - - - - - - - - - - - - - - > Fourth Realm Solutions > pbechard@fourthrealm.com > http://www.fourthrealm.com > Tel: 519-739-1652 > - - - - - - - - - - - - - - - - - - - - - >

« previous php.general (#113756) next »