Regular expressions are slow. If you need to do some fancy searches, then they
are pretty nice, but if you're just looking for a string in another string,
the stristr() function is faster. (easier to learn too!)
-Micah
On Sunday 03 April 2005 02:48 pm, Josip Dzolonga wrote:
> Matthew Weier O
Matthew Weier O'Phinney wrote:
> if (strpos($query_holder, "big fat")) {
> // found
> }
That's completely wrong. Well try this :
$string = "big fat fatty";
if (strpos($string, "big fat")) echo 'found';
else echo 'not found';
It will always return false, because strpos in this case r
stristr is another way www.php.net/stristr
Bastien
From: Justin Gruenberg <[EMAIL PROTECTED]>
Reply-To: Justin Gruenberg <[EMAIL PROTECTED]>
To: Ron Piggott <[EMAIL PROTECTED]>, php-db@lists.php.net
Subject: Re: [PHP-DB] That crazy IF command!
Date: Sun, 3 Apr 2005 15:05:30 -050
Many thanks! Ron
- Original Message -
From: Justin Gruenberg <[EMAIL PROTECTED]>
To: Ron Piggott <[EMAIL PROTECTED]>;
Sent: Sunday, April 03, 2005 3:05 PM
Subject: Re: [PHP-DB] That crazy IF command!
> On Apr 2, 2005 3:52 PM, Ron Piggott <[EMAIL PROTECTED]> wrot
On Apr 2, 2005 3:52 PM, Ron Piggott <[EMAIL PROTECTED]> wrote:
> Hey guys ... I am wondering if you have a varable named
>
> $query_holder="the big fat cow made lots of milk today";
>
> are you able to use the if command to see if the words "big fat" are part of
> that phrase?
>
> What would the
Hey guys ... I am wondering if you have a varable named
$query_holder="the big fat cow made lots of milk today";
are you able to use the if command to see if the words "big fat" are part of
that phrase?
What would the syntax be?
Ron
--
PHP Database Mailing List (http://www.php.net/)
To unsubs